The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
This code works just fine on localhost, running PHP 5.0.5. On the live site, running PHP 4.3.2, I get the following error:
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /var/www/html/includes/class_bbcode.php(149) : eval()'d code on line 14 PHP Code:
|
#2
|
||||
|
||||
![]()
I dont believe php 4 supports references in a foreach construct, which you shouldnt being using regardless.
The nature of foreach is to use a copy of an array and go through it key by key, if you want to operate on references, it would be better to use a for construct $keys = count($array); for ($i=0;$i<=$keys;$i++) { $option = &$array[$i]; } and so on |
#3
|
|||
|
|||
![]()
There's nothing wrong with using foreach in most cases. Passing damn near everything by reference introduces more opportunities to screw up the orignal data bacause you accidently modify one of the elements.
Knowing specifically what line 14 is would help. |
#4
|
||||
|
||||
![]()
I was basing my reply to him on the knowledge of php4 object model specifically having problems with references in foreach constructs.
But you are right, nothing wrong with using foreach in most cases (cept large arrays where copying an array might cause excessive memory usage). |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|