3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class T { public $a = string_to_ascii("Perkele") public 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 2M8KP
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ';' in /in/hahha 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/hahha on line 4
Process exited with code 255.