3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bob{ public $args; public $something = 2; public _construct(){ $args= array(1,2,3,4); } } $b = new bob(); echo json_encode ($b); ?>
Output for 5.4.0 - 5.4.16
Parse error: syntax error, unexpected '_construct' (T_STRING), expecting variable (T_VARIABLE) in /in/V2Cu6 on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.26
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/V2Cu6 on line 8
Process exited with code 255.

preferences:
185.36 ms | 940 KiB | 52 Q