Bug #17106 Updated: Session variable disappears
ID: 17106 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Session related Operating System: Win98, Win2000 Pro PHP Version: 4.1.2 New Comment: Can you supply a small script reproducing this problem also how frequent it happens? every page view or random or every 10 page views? _ brad Previous Comments: [2002-05-14 00:24:26] [EMAIL PROTECTED] For f#cks sake, we STILL have this damn problem under 4.2.1 as well. This is really starting to p#ss me off - we generate a HUGE amount of traffic, one of the top ten movie related sites in this country, and this session problem is causing viewers to constantly reload pages so that their bloody cookie logs them in - thus our bandwidth is shooting through the bloody roof (read $ down the toilet)... [2002-05-13 20:32:50] [EMAIL PROTECTED] The last version for which this script works on all my tested platforms (Win98-Win2000, Apache1.3.22, Netscape 4.75) is 4.0.6. Using the php4xx-installer.exe for MS Windows. Also note that 4.0.6 does NOT register PHP in the MS Win registry, whereas versions = 4.1.0 DO register it. Could the registry be causing problems with session variables? Just a question from an un-initiated user. Lee [2002-05-13 19:28:07] [EMAIL PROTECTED] 14 May 2002 PHP 4.2.1, all other settings as before Same behavior as 4.2.0 - on submit the login prompt immediately re-appears. So has NOT been fixed. The last version for which this script works is 4.1.0 Lee [2002-05-09 01:34:57] [EMAIL PROTECTED] I found the following on Zend's site: FIX: 4.2.0 session SID broken Sascha Schumann has posted a fix for problems with the session SID under 4.2.0. If you need it immediately, the fix can be found at http://apache.org/~sascha/php-420-session-fix, or will be available in 4.2.1 along with the other fixes since 4.2.0. Sounds like it may resolve the issue we're having??? [2002-05-08 22:18:00] [EMAIL PROTECTED] Sequence of tests: originally running php4.1.0 Un-installed that, installed php4.2.0 - found bug. Un-installed php4.2.0, installed php4.1.2 - still bug. Same behavior if Apache/php and Netscape on same machine (using 127.0.0.1 or localhost) or on different machines with different users. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17106 -- Edit this bug report at http://bugs.php.net/?id=17106edit=1
Bug #16981 Updated: Variable Scrope suggestion
ID: 16981 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Closed +Status: Bogus Bug Type: Variables related Operating System: Windows XP PHP Version: 4.1.2 New Comment: bogusing Previous Comments: [2002-05-02 18:58:41] [EMAIL PROTECTED] Sorry bout that, I figured out what I wasn't doing... [2002-05-02 18:51:39] [EMAIL PROTECTED] Okay basically this isn't a bug, more of an annoyance though I thought it should be pointed out. As you all know variable scope in functions determines that $var1 outside a function is not the same a $var1 inside the function, so you must pass $var1 to the function. Basic stuff. Anyhow, there are many variables built into PHP such as $PHP_SELF that still comply to the variable scope rules, which I think is *very* annoying. I do not think it should be necessary to pass something like $PHP_SELF to your function if you need to call it within. I dunno, maybe I'm just whining, but there you have it. -- Edit this bug report at http://bugs.php.net/?id=16981edit=1
Bug #16926 Updated: Shuffle doesn't work
ID: 16926 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Duplicate Bug Type: *Math Functions Operating System: WinXP PHP Version: 4.2.0 New Comment: I made patch for this awhile ago. It never was commited. http://bugs.php.net/bug.php?id=7045 Previous Comments: [2002-05-01 05:06:50] [EMAIL PROTECTED] Yes, I'm sure. I've tried running it from the command line with the same result. I've done a little more testing, and it seems that rand() seems to work just fine, so that should more or less exclude the possibility of a bug in srand(). I've also done a full reinstall (just to make sure) without any luck. [2002-05-01 03:08:01] [EMAIL PROTECTED] I could not reproduce this, are you sure the browser is not caching your page? Derick [2002-04-30 08:14:09] [EMAIL PROTECTED] As of PHP 4.2.0, shuffle() doesn't seem to work for me. The following code always produce the same output: function make_seed() { // Taken directly from the manual list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 10); } srand(make_seed()); $arr = range(1, 10); shuffle($arr); print_r($arr); Further testing shows that I get the same output if I uncomment the srand(), if that's any help. -- Edit this bug report at http://bugs.php.net/?id=16926edit=1
Bug #7515 Updated: very weird, magic, invisible referencing
ID: 7515 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Assigned +Status: Critical Bug Type: Scripting Engine problem Operating System: linux + win2k PHP Version: 4.0 Latest CVS (28/10/2000) Assigned To: andre New Comment: I have reproducted this problem... and am pretty sure what is exactly is going wrong... ? class foo { function foo() { $this-bar = new bar(); } } class bar { function bar() { $this-tmp = bar; } function do_nothing() { } } $foo = new foo(); $foo-bar-tmp = test; $foo2 = $foo; $foo2-bar-tmp = foo; var_dump($foo); var_dump($foo2); // now $foo-bar-do_nothing(); $foo3 = $foo; $foo3-bar-tmp = bug; var_dump($foo); var_dump($foo3); ? Basically when you call a method from a objects member object. It creates that member as a refrence. /* i set this to critical because i think this should be resloved right away */ - Brad Previous Comments: [2002-01-11 16:11:31] [EMAIL PROTECTED] I'm looking at putting php 4.1.1 into the next RH release however I noticed that this bug still seems to be happening (From make test) Running tests in /usr/src/redhat/php-4.1.1//tests/lang ... OO Bug Test (Bug #7515) (029.phpt) ... failed [root@dhcpd201 lang]# cat 029.exp success [root@dhcpd201 lang]# cat 029.out failure I this something that can either be fixed or can I turn a blind eye to this.. Phil =--= [2001-12-12 08:14:56] [EMAIL PROTECTED] Is this still a issue? This report is updated a year ago... If this report is outstanding, PHP Version is better to be updated... [2000-12-16 13:40:39] [EMAIL PROTECTED] assigned to zeev, as discussed we either need a) a permanent fix b) a permanent deep copy function and understand this effect as a feature and users will eventually have to use deep copies for some containers [2000-10-28 10:25:28] [EMAIL PROTECTED] This code is pretty self-explanatory... Uncommenting the noticed (*[0]) line, causes the object contained ('root') in the instance of 'obj' to be referenced to whatever, function test() uses a copy $o_copy but reference-counting fails and the contained object 'root' is somehow referenced to the original object in the global scope. After having uncommented *[0] try to uncomment *[1] what should break the reference again, that made me assuming this all is caused by reference counting... ?php class obj { function method() {} } function test($o_copy) { //$o_copy-root=$o_copy-root; // *[1] $o_copy-root-set_in_copied_o=TRUE; var_dump($o_copy);?BR?php } $o-root=new obj(); //$o-root-method(); // *[0] uncomment this line and weirdness starts var_dump($o);?BR?php test($o); var_dump($o); ? -- Edit this bug report at http://bugs.php.net/?id=7515edit=1
Bug #13276 Updated: Java methods are incorrectly set to lowercase
ID: 13276 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: No Feedback +Status: Bogus Bug Type: Java related Operating System: Solaris 2.7 PHP Version: 4.0.6 New Comment: Because php is case insensitive this is the reason for this bug.. Can't do anything about it unless php goes case sensitive. Previous Comments: [2002-04-07 00:00:02] [EMAIL PROTECTED] No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2002-02-24 06:13:09] [EMAIL PROTECTED] Please test with PHP 4.1.1+JDK 1.2 and report the result back Please do not forget updating PHP version. Thanks. [2001-09-12 19:40:27] [EMAIL PROTECTED] Take the following code: public class phptest{ public static String testString = look for ^ in this string; public static void main(String[] args) { System.out.println(Found ^ at: +testString.indexOf('^')); } } Which when run in Java produces this output: Found ^ at: 9 Now, consider the following php code: ?php $phptest = new Java(phptest); printf(Found ^ at: %d\n, $phptest-$testString-indexOf('^')); ? This *almost* works, and produces the following output: X-Powered-By: PHP/4.0.6 Content-type: text/html br bWarning/b: java.lang.NoSuchMethodException: indexof in bphptest.php/b on line b5/bbr Found ^ at: 0 As you can see, the indexof method has been lowercased from indexOf. This is a problem in the case sensitive environment of Java. -- Edit this bug report at http://bugs.php.net/?id=13276edit=1
Bug #16213 Updated: Ignores Escape Codes
ID: 16213 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Output Control Operating System: Windows XP Pro PHP Version: 4.1.1 New Comment: This functionality work fine.. your example echo Line 1; echo Line 2; should print Line 1Line 2 if you want to do something like this echo Line 1\nLine 2\n; or echo Line 1 Line2 ; - Brad Previous Comments: [2002-03-21 17:07:20] [EMAIL PROTECTED] The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php [2002-03-21 17:03:51] [EMAIL PROTECTED] To quote the manual's example echo This spans multiple lines. The newlines will be output as well; echo This spans\nmultiple lines. The newlines will be\noutput as well.; simply does not work... When escape codes are entered it shows up exactly as written minus the escape codes. if i were to ? echo Line 1; echo Line 2; ? the output on the page would be Line 1Line 2 -- Edit this bug report at http://bugs.php.net/?id=16213edit=1
Bug #16213 Updated: Ignores Escape Codes
ID: 16213 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Output Control Operating System: Windows XP Pro PHP Version: 4.1.1 New Comment: I see what you are doing.. It's still not a bug... You are viewing this in a web browser correct? You are printing hard returns not br's echo Line 1br; echo Line 2br; the other way if you view source you would see the Lines on different lines... So this bug is still bogus. Previous Comments: [2002-03-21 17:36:10] [EMAIL PROTECTED] It is a support question because it is an HTML 101 question that most people new to this stuff asks at some point. Newlines mean nothing in HTML unless you are inside a pre /pre block. Do a view source and you will see your newlines. If you want an actual newline in the HTML rendering you need to output br / This is not, has never been, and will never be a PHP bug. [2002-03-21 17:33:42] [EMAIL PROTECTED] ok I apologize for that... the internet connection here at work has been intermittant and I wanted to get it up as fast as possible... the ? echo Line 1; echo Line 2; ? should of shown ? echo Line 1\n; echo Line 2\n; ? and it still prints Line 1Line 2 as for [EMAIL PROTECTED] I don't see how this is a support question.. it's a bug somewhere between php apache for win, because the same page of code works fine when ran on php apache in Mandrake. [2002-03-21 17:07:41] [EMAIL PROTECTED] This functionality work fine.. your example echo Line 1; echo Line 2; should print Line 1Line 2 if you want to do something like this echo Line 1\nLine 2\n; or echo Line 1 Line2 ; - Brad [2002-03-21 17:07:20] [EMAIL PROTECTED] The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php [2002-03-21 17:03:51] [EMAIL PROTECTED] To quote the manual's example echo This spans multiple lines. The newlines will be output as well; echo This spans\nmultiple lines. The newlines will be\noutput as well.; simply does not work... When escape codes are entered it shows up exactly as written minus the escape codes. if i were to ? echo Line 1; echo Line 2; ? the output on the page would be Line 1Line 2 -- Edit this bug report at http://bugs.php.net/?id=16213edit=1
Bug #8449 Updated: register_globals=on and track_vars=on produce strange results for arrays
ID: 8449 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Critical +Status: Bogus Bug Type: Arrays related Operating System: linux PHP Version: 4.1.0RC1 New Comment: I looked into this... When you have register globals on it registers the $person as a global array when parsing the get request it adds [age] to the global $person array then when the post requet is parsed then it finds the global array and adds the [sname] to the same array. So this is what should happen. why are you using get and post requests... why don't you just use input type=hidden name=person[blah] value=blah Previous Comments: [2001-10-21 01:27:24] [EMAIL PROTECTED] Reproduced also with PHP 4.1.0RC1 Here is the complete script for all the lazy developers to try with: form.php: - form action=form.php?person[age]=12 method=post input type=text size=32 name=person[sname] /form br ?php echo HTTP_POST_VARSbr; print_r($HTTP_POST_VARS); echo p; echo HTTP_GET_VARSbr; print_r($HTTP_GET_VARS); echo p; echo _POSTbr; print_r($_POST); echo p; echo _GETbr; print_r($_GET) ? [2001-08-19 03:01:43] [EMAIL PROTECTED] Oops. I had register_globals=off in my php.ini. Then this works as expected. But when it is On, not. --Jani [2001-08-19 02:57:36] [EMAIL PROTECTED] This is fixed at least in PHP 4.0.6. Maybe even earlier. --Jani [2000-12-28 02:49:06] [EMAIL PROTECTED] I was trying to make the example as short as possible so it looks stupid but it clearly demonstrates the problem. Two short examples o *correct* behaviour first: Example 1: form action=bug.php?age=12 method=post input type=text size=32 name=sname /form the form sets age using url path and sname using post. I could use cookies for age but the example longer. The idea is to simultaniously use several different methods to pass the variables. Nothing unusual here. tarck_vars and register_globals are both on so in bug.php I have access to $HTTP_GET_VARS[age],$HTTP_POST_VARS[sname] and to $age, $sname. I have no $HTTP_GET_VARS[sname] and $HTTP_POST_VARS[age] and I should not to. So far so good. Example 2: let's try the following: form action=bug.php?sname=Pupkin method=post input type=text size=32 name=sname value='Collins' /form I use the same variable name in both requests. Now I have $HTTP_GET_VARS[sname] == 'Pupkin' and $HTTP_POST_VARS[sname]='Collins' and that is also correct and that is how can I check what method was used to pass the variable (the global $sname value depends on variables_order ofcourse) Example 3: the bug but let's put the variables into array: form action=bug?person[age]=12 method=post input type=text size=32 name=person[sname] /form Now I expect to have $person[age],$person[$sname] in my global space and $HTTP_POST_VARS[person][sname], $HTTP_GET_VARS[person][age]... right? The bug is that I also have both $HTTP_POST_VARS[person][age] and $HTTP_GET_VARS[person][sname] defined... Do you see the problem? person[age] has somehow propagated into $HTTP_POST_VARS while I had no person[age] in my post request... Now I have no way to find how was that variable passed to my script... If I have an person[id] defined in the cookie then I suddenly have also person[age] and person[sname] defined in HTTP_COOKIE_VARS and pesron[id] defined in both POST_VARS and GET_VARS! looks like a bug for me. Comments? oleg -- Edit this bug report at http://bugs.php.net/?id=8449edit=1
Bug #9507 Updated: Java Classes and session_register
ID: 9507 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Analyzed Bug Type: Java related Operating System: Windows 2000 PHP Version: 4.0.4pl1 New Comment: Ok since Java is an incomplete class it can't be searlized currently. ?php $java = new Java(java.lang.System); echo serialize($java); ? prints O:4:java:1:{i:0;i:1;} so if this functionality is really needed one of two things needs to happen. 1) the java class has a __wakeup and __sleep functions that keeps around the constructor arguments and makes a new object on each unseralize. Not really gaining much functionality here. cause you can just make the java object yourself without using it as a session. 2) make the java class use __wakeup and __sleep functions that acually call the java seralize and unseralize functions.. take that data and write it out with the php seralized data. Personally i would like to see number 2 work. It would be pretty nice. I have already thought of doing this. I just need to get around to do it. Just changing the java extension isn't gunna do it. We need to change call_user_function() to call incomplete objects. I have alredy written this code i just need to apply it. - Brad Previous Comments: [2002-02-24 06:08:00] [EMAIL PROTECTED] Please test with PHP 4.1.1+JDK 1.2 and report the result back Please do not forget updating PHP version. Thanks. [2001-06-22 02:22:17] [EMAIL PROTECTED] ?php session_start(); if (!session_is_registered(system)) { $system = null; $system = new Java(java.lang.System); session_register(system); } print $system-getProperty(java.version); ? The above code works upon first request, but gives a Warning: java.lang.NullPointerException in e:\server\htdocs\test.php on line 10 in subsequent requests. After commenting out the session_start() call it works fine, which is weird IMHO since session_register() implictly calls session_start(). Tested with PHP 4.0.7-dev (latest CVS), Java 2 SDK 1.3, Java HotSport Server VM 2.0. [2001-03-01 04:30:15] [EMAIL PROTECTED] Hi, I'm trying to save a Java class into a session variable like the code bellow: if ( !session_is_registered( objJC ) ) { $objJC = null; $objJC = new Java( JavaClass ); session_register( objJC ); } This code works for the 1st time, when the session var 'objJC' is registered for the 1st time. All the methods of the java class can be accessed. The next times the variable 'objJC' already exists, as a session var, but i cannot access the methods inside, and gives me the error message like: Warning: java.lang.NoSuchMethodException: doinitmapj in c:\program files\apache group\apache\htdocs\php\php_mapxt.php on line 71 When you do this with a normal PHP class, using include() or required( ), everything works ok. It seems that the registration doesn't keep the class type as a Java Class. Can someone help me with this? Than you very much in advance. Carlos Figueiredo -- Edit this bug report at http://bugs.php.net/?id=9507edit=1