3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tokens = token_get_all(<<<EOP <?php echo strpos('Hello World', 0, -5).'Wouter'; EOP ); var_dump(array_map(function ($token) { return sprintf('Regel %d %s %s', $token[0], trim($token[1]), token_name($token[2])); }, $tokens));
based on 4V75O
Output for 7.0.0 - 7.1.0
Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be integer, string given in /in/QIEQk on line 12 array(18) { [0]=> string(23) "Regel 379 <?php UNKNOWN" [1]=> string(18) "Regel 382 UNKNOWN" [2]=> string(22) "Regel 328 echo UNKNOWN" [3]=> string(18) "Regel 382 UNKNOWN" [4]=> string(24) "Regel 319 strpos UNKNOWN" [5]=> string(9) "Regel 0 " [6]=> string(31) "Regel 323 'Hello World' UNKNOWN" [7]=> string(9) "Regel 0 " [8]=> string(18) "Regel 382 UNKNOWN" [9]=> string(19) "Regel 317 0 UNKNOWN" [10]=> string(9) "Regel 0 " [11]=> string(18) "Regel 382 UNKNOWN" [12]=> string(9) "Regel 0 " [13]=> string(19) "Regel 317 5 UNKNOWN" [14]=> string(9) "Regel 0 " [15]=> string(9) "Regel 0 " [16]=> string(26) "Regel 323 'Wouter' UNKNOWN" [17]=> string(9) "Regel 0 " }
Output for 5.6.7 - 5.6.28
Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 array(18) { [0]=> string(23) "Regel 376 <?php UNKNOWN" [1]=> string(18) "Regel 379 UNKNOWN" [2]=> string(22) "Regel 319 echo UNKNOWN" [3]=> string(18) "Regel 379 UNKNOWN" [4]=> string(24) "Regel 310 strpos UNKNOWN" [5]=> string(9) "Regel 0 " [6]=> string(31) "Regel 318 'Hello World' UNKNOWN" [7]=> string(9) "Regel 0 " [8]=> string(18) "Regel 379 UNKNOWN" [9]=> string(19) "Regel 308 0 UNKNOWN" [10]=> string(9) "Regel 0 " [11]=> string(18) "Regel 379 UNKNOWN" [12]=> string(9) "Regel 0 " [13]=> string(19) "Regel 308 5 UNKNOWN" [14]=> string(9) "Regel 0 " [15]=> string(9) "Regel 0 " [16]=> string(26) "Regel 318 'Wouter' UNKNOWN" [17]=> string(9) "Regel 0 " }
Output for 5.5.24 - 5.5.35
Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 array(18) { [0]=> string(23) "Regel 374 <?php UNKNOWN" [1]=> string(18) "Regel 377 UNKNOWN" [2]=> string(22) "Regel 317 echo UNKNOWN" [3]=> string(18) "Regel 377 UNKNOWN" [4]=> string(24) "Regel 308 strpos UNKNOWN" [5]=> string(9) "Regel 0 " [6]=> string(31) "Regel 316 'Hello World' UNKNOWN" [7]=> string(9) "Regel 0 " [8]=> string(18) "Regel 377 UNKNOWN" [9]=> string(19) "Regel 306 0 UNKNOWN" [10]=> string(9) "Regel 0 " [11]=> string(18) "Regel 377 UNKNOWN" [12]=> string(9) "Regel 0 " [13]=> string(19) "Regel 306 5 UNKNOWN" [14]=> string(9) "Regel 0 " [15]=> string(9) "Regel 0 " [16]=> string(26) "Regel 316 'Wouter' UNKNOWN" [17]=> string(9) "Regel 0 " }
Output for 5.4.0 - 5.4.45
Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 array(18) { [0]=> string(23) "Regel 372 <?php UNKNOWN" [1]=> string(18) "Regel 375 UNKNOWN" [2]=> string(22) "Regel 316 echo UNKNOWN" [3]=> string(18) "Regel 375 UNKNOWN" [4]=> string(24) "Regel 307 strpos UNKNOWN" [5]=> string(9) "Regel 0 " [6]=> string(31) "Regel 315 'Hello World' UNKNOWN" [7]=> string(9) "Regel 0 " [8]=> string(18) "Regel 375 UNKNOWN" [9]=> string(19) "Regel 305 0 UNKNOWN" [10]=> string(9) "Regel 0 " [11]=> string(18) "Regel 375 UNKNOWN" [12]=> string(9) "Regel 0 " [13]=> string(19) "Regel 305 5 UNKNOWN" [14]=> string(9) "Regel 0 " [15]=> string(9) "Regel 0 " [16]=> string(26) "Regel 315 'Wouter' UNKNOWN" [17]=> string(9) "Regel 0 " }
Output for 5.3.0 - 5.3.29
Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 Notice: Uninitialized string offset: 1 in /in/QIEQk on line 12 Notice: Uninitialized string offset: 2 in /in/QIEQk on line 12 Warning: token_name() expects parameter 1 to be long, string given in /in/QIEQk on line 12 array(18) { [0]=> string(23) "Regel 368 <?php UNKNOWN" [1]=> string(18) "Regel 371 UNKNOWN" [2]=> string(22) "Regel 316 echo UNKNOWN" [3]=> string(18) "Regel 371 UNKNOWN" [4]=> string(24) "Regel 307 strpos UNKNOWN" [5]=> string(9) "Regel 0 " [6]=> string(31) "Regel 315 'Hello World' UNKNOWN" [7]=> string(9) "Regel 0 " [8]=> string(18) "Regel 371 UNKNOWN" [9]=> string(19) "Regel 305 0 UNKNOWN" [10]=> string(9) "Regel 0 " [11]=> string(18) "Regel 371 UNKNOWN" [12]=> string(9) "Regel 0 " [13]=> string(19) "Regel 305 5 UNKNOWN" [14]=> string(9) "Regel 0 " [15]=> string(9) "Regel 0 " [16]=> string(26) "Regel 315 'Wouter' UNKNOWN" [17]=> string(9) "Regel 0 " }
Output for 4.4.3 - 4.4.9, 5.1.0 - 5.1.1, 5.1.3 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/QIEQk on line 11
Process exited with code 255.
Output for 4.4.2, 5.1.2
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/QIEQk on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/QIEQk on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/QIEQk on line 11
Process exited with code 255.