3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = 'aresa'; $value = 'someValue'; $user_id = 'someID'; var_dump("\n[start]" . time() . "|$name|$value|$user_id" . '[end]'); // this derefers $user_id somehow (end it probably evaled to false (which is 0) so $user_id[0] var_dump(PHP_EOL . '[start]' . time() . '|' . $name . '|' . $value . '|' . $user_id . '[end]'); class Foo { public function foo($name = '', $value = '', $user_id = '') { $inputString = "\n[start]" . time() . "|$name|$value|$user_id" . '[end]'; var_dump($inputString); } } $x = new Foo; $x->foo($name, $value, $user_id);
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.4, 7.2.6 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/LDiiY on line 8 string(46) " [start]1409394811|aresa|someValue|someID[end]" string(46) " [start]1409394811|aresa|someValue|someID[end]" string(26) " [start]1409394811|||[end]" string(46) " [start]1409394811|aresa|someValue|someID[end]"
Output for 7.2.5
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/LDiiY on line 8 string(46) " [start]1409394811|aresa|someValue|someID[end]" string(46) " [start]1409394812|aresa|someValue|someID[end]" string(26) " [start]1409394812|||[end]" string(46) " [start]1409394812|aresa|someValue|someID[end]"
Output for 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
string(46) " [start]1409394811|aresa|someValue|someID[end]" string(46) " [start]1409394811|aresa|someValue|someID[end]" string(26) " [start]1409394811|||[end]" string(46) " [start]1409394811|aresa|someValue|someID[end]"
Output for 5.0.0 - 5.0.1
string(46) " [start]1409394811|aresa|someValue|someID[end]" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/LDiiY on line 6 string(52) "PHP_EOL[start]1409394811|aresa|someValue|someID[end]" string(26) " [start]1409394811|||[end]" string(46) " [start]1409394811|aresa|someValue|someID[end]"
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LDiiY on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LDiiY on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/LDiiY on line 9
Process exited with code 255.

preferences:
228.18 ms | 401 KiB | 263 Q