3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class PC { } class Part { } $part = new Part(); $pc = new PC(); $part->name = 'CPU'; $pc->arr[] = $part; $part->name = 'GPU'; $pc->arr[] = $part; print_r($pc);
Output for 5.0.0 - 7.1.0
PC Object ( [arr] => Array ( [0] => Part Object ( [name] => GPU ) [1] => Part Object ( [name] => GPU ) ) )
Output for 4.3.0 - 4.4.9
pc Object ( [arr] => Array ( [0] => part Object ( [name] => CPU ) [1] => part Object ( [name] => GPU ) ) )