3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Potatoe { public $skin; protected $meat; private $roots; function __construct ( $s, $m, $r ) { $this->skin = $s; $this->meat = $m; $this->roots = $r; } } $p = new Potatoe(); var_dump(get_object_vars($p), array_values( (array) $p ));
based on OABjg
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Potatoe::__construct(), 0 passed in /in/h9FSN on line 15 and exactly 3 expected in /in/h9FSN:8 Stack trace: #0 /in/h9FSN(15): Potatoe->__construct() #1 {main} thrown in /in/h9FSN on line 8
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Warning: Missing argument 1 for Potatoe::__construct(), called in /in/h9FSN on line 15 and defined in /in/h9FSN on line 8 Warning: Missing argument 2 for Potatoe::__construct(), called in /in/h9FSN on line 15 and defined in /in/h9FSN on line 8 Warning: Missing argument 3 for Potatoe::__construct(), called in /in/h9FSN on line 15 and defined in /in/h9FSN on line 8 Notice: Undefined variable: s in /in/h9FSN on line 9 Notice: Undefined variable: m in /in/h9FSN on line 10 Notice: Undefined variable: r in /in/h9FSN on line 11 array(1) { ["skin"]=> NULL } array(3) { [0]=> NULL [1]=> NULL [2]=> NULL }