3v4l.org

run code in 300+ PHP versions simultaneously
<?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 ));
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
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.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 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 }

preferences:
192.27 ms | 403 KiB | 259 Q