3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class T { public $a = string_to_ascii("Perkele") function string_to_ascii($string) { $ascii = NULL; for ($i = 0; $i < strlen($string); $i++) { $ascii += ord($string[$i]); } return($ascii); } } $t = new T(); var_dump($t->a);
based on 8HUD3
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting ',' or ';' in /in/2M8KP on line 6
Process exited with code 255.
Output for 5.3.21 - 5.6.17
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /in/2M8KP on line 4
Process exited with code 255.