ID: 35367 User updated by: andrus at wap3 dot net Reported By: andrus at wap3 dot net Status: Open Bug Type: Scripting Engine problem Operating System: Debian Linux PHP Version: 4.4.1 (also 5.1.0) New Comment:
tested with latest snapshot, same result Previous Comments: ------------------------------------------------------------------------ [2005-11-27 10:34:51] andrus at wap3 dot net tested also on 5.1.0, same result ------------------------------------------------------------------------ [2005-11-27 10:22:06] andrus at wap3 dot net bug was not just class related, but seems general recrussion related: following code produced crash on 3 server i tested: file1: test.php <?php error_reporting (E_ALL); require ("test2.php"); $im_resize_res_max = '1600x1200'; $im_resize_res_min = '120x120'; resolution_check ("1x1", "2x2"); print "OK"; ?> file2: test2.php <?php /* check if $res1 is fits inside $res2 */ function resolution_check ($res1 = '', $res2 = '') { global $im_resize_res_max, $im_resize_res_min; if (!strchr ($res1, 'x') || !strchr ($res2, 'x')) // invalid resolutions return -1; // check if not too big or too small image if (resolution_check ($res1, $im_resize_res_max) != 1) return -2; if (resolution_check ($res1, $im_resize_res_min) == 1) return -3; list ($x1, $y1) = explode ('x', $res1, 2); list ($x2, $y2) = explode ('x', $res2, 2); $x1 = (int) $x1; $x2 = (int) $x2; $y1 = (int) $y1; $y2 = (int) $y2; if ($x1 <= 0 || $x2 <= 0 || $y1 <= 0 || $y2 <= 0) // invalid return -1; if ($x2 >= $x1 && $y2 >= $y1) // match return 1; return 0; } ?> when i run test.php it never completes. same time if i copy this function to same source file it worked. Unfortunately i dont have gdb access right now. If you cannot reporduce it i will deal with administration about it. ------------------------------------------------------------------------ [2005-11-24 16:19:01] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. I can't see any crashes or exits with this code. ------------------------------------------------------------------------ [2005-11-24 15:55:11] andrus at wap3 dot net Description: ------------ Function terminates while calling itself from itself inside class Reproduce code: --------------- make class: class test { function foo ($a = 0) { $a++; if ($a < 10) $a = $this->foo ($a); return $a; } } use it: $a = new test; print $a->foo (1); Expected result: ---------------- any result, not termination Actual result: -------------- php script terminates on $this->foo place ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35367&edit=1