3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User{ var $username; var $created; var $actions = array(); var $sort; var $filterby; var $filtervalue; function __construct($username){ $this->username = $username; $this->created = new DateTime(null); $this->sort = "User::action_sort_name"; $this->filterby=null; $this->filtervalue=null; } function get_username(){ return $this->username; } function add_action($pillname){ array_push($this->actions, new Action($pillname) ); } function set_sort_method($sort_name){ $this->sort = $sort_name; } function get_sort_method(){ return $this->sort; } function sort_actions(){ usort($this->actions, $this->sort); } function get_display_actions(){ if ($this->filtervalue != null){ $res = array_filter($this->actions, $this->filterby); $pr = print_r($res, true); return $res; } return $this->actions; } function get_pill_names(){ $pill_names = array(); foreach($this->actions as $action){ array_push($pill_names, $action->pillname); } return array_unique($pill_names); } function set_filtervalue($val){ $this->filtervalue = $val; } function set_filterby($val){ $this->filterby = $val; } public function action_filter_name($a){ $res = ($a->pillname == $this->filtervalue); return $res; } public function action_filter_time($a){ /* before this time */ if ($a > $this->filtervalue){ return true; } } public static function action_sort_name($a, $b){ if ($a->pillname == $b->pillname){ return 0; } return ($a->pillname < $b->pillname) ? -1 : 1 ; } public static function action_sort_date($a, $b){ if ($a->datetime == $b->datetime){ return 0; } return ($a->datetime < $b->datetime) ? -1 : 1 ; } } class Action{ var $pillname; var $datetime; function __construct($pillname){ $this->pillname = $pillname; $this->datetime = new DateTime(null); } } echo serialize(new User('attack')) ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0000.01516.88
8.3.50.0160.00316.38
8.3.40.0070.00718.96
8.3.30.0070.00719.02
8.3.20.0040.00420.18
8.3.10.0050.00223.71
8.3.00.0080.00019.63
8.2.180.0080.00818.30
8.2.170.0040.01122.96
8.2.160.0100.01020.34
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0060.00319.48
8.2.120.0080.00026.35
8.2.110.0070.00322.11
8.2.100.0030.00919.48
8.2.90.0080.00017.75
8.2.80.0000.00819.09
8.2.70.0030.00619.32
8.2.60.0080.00017.75
8.2.50.0000.00817.50
8.2.40.0040.00417.63
8.2.30.0000.00718.01
8.2.20.0000.01017.97
8.2.10.0040.00418.01
8.2.00.0000.00918.09
8.1.280.0060.00925.92
8.1.270.0070.00323.68
8.1.260.0030.00528.09
8.1.250.0040.00428.09
8.1.240.0060.00320.84
8.1.230.0040.00817.83
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0050.00517.48
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0030.00517.62
8.1.160.0040.00418.92
8.1.150.0040.00418.83
8.1.140.0080.00022.22
8.1.130.0000.00717.75
8.1.120.0000.00717.64
8.1.110.0000.00717.64
8.1.100.0020.00517.52
8.1.90.0000.00817.52
8.1.80.0040.00417.66
8.1.70.0030.00317.62
8.1.60.0000.00717.63
8.1.50.0030.00517.61
8.1.40.0090.00317.69
8.1.30.0030.00617.88
8.1.20.0030.00617.75
8.1.10.0030.00517.72
8.1.00.0030.00517.78
8.0.300.0000.00818.77
8.0.290.0030.00517.00
8.0.280.0000.00818.24
8.0.270.0040.00418.23
8.0.260.0030.00317.41
8.0.250.0000.00717.22
8.0.240.0030.00317.17
8.0.230.0030.00517.05
8.0.220.0000.00716.96
8.0.210.0040.00417.02
8.0.200.0070.00017.04
8.0.190.0050.00317.01
8.0.180.0050.00216.93
8.0.170.0000.00817.09
8.0.160.0070.00017.07
8.0.150.0040.00416.95
8.0.140.0080.00017.05
8.0.130.0050.00013.38
8.0.120.0000.00816.92
8.0.110.0000.00816.95
8.0.100.0080.00017.07
8.0.90.0000.00717.12
8.0.80.0000.01417.06
8.0.70.0040.00416.88
8.0.60.0000.00816.95
8.0.50.0000.00717.11
8.0.30.0080.01317.32
8.0.20.0130.00517.40
8.0.10.0040.00417.00
8.0.00.0070.01016.97
7.4.330.0000.00516.71
7.4.320.0000.00616.45
7.4.300.0040.00416.66
7.4.290.0040.00416.53
7.4.280.0040.00416.45
7.4.270.0000.00716.70
7.4.260.0000.00816.64
7.4.250.0000.00816.69
7.4.240.0050.00316.67
7.4.230.0030.00316.45
7.4.220.0110.00716.53
7.4.210.0070.01416.53
7.4.200.0000.00716.64
7.4.160.0120.00316.63
7.4.150.0070.01017.40
7.4.140.0070.01417.86
7.4.130.0090.01116.78
7.4.120.0080.01316.82
7.4.110.0140.00416.70
7.4.100.0120.00616.64
7.4.90.0040.01416.79
7.4.80.0070.01019.39
7.4.70.0060.01216.84
7.4.60.0030.01316.64
7.4.50.0070.00716.43
7.4.40.0060.01616.57
7.4.30.0120.00716.59
7.4.00.0000.01714.89
7.3.330.0070.00013.48
7.3.320.0000.00513.43
7.3.310.0030.00516.46
7.3.300.0030.00316.51
7.3.290.0080.00816.47
7.3.280.0120.00616.49
7.3.270.0160.00317.40
7.3.260.0140.00616.57
7.3.250.0080.01116.56
7.3.240.0090.00816.54
7.3.230.0160.00716.58
7.3.210.0100.00716.77
7.3.200.0120.00516.74
7.3.190.0060.00916.76
7.3.180.0130.00316.73
7.3.170.0070.01016.55
7.3.160.0090.00816.74
7.3.10.0000.01316.81
7.3.00.0000.01316.93
7.2.330.0090.00916.77
7.2.320.0100.01416.86
7.2.310.0030.01516.52
7.2.300.0070.01016.57
7.2.290.0090.00916.70
7.2.130.0090.00617.02
7.2.120.0030.01017.01
7.2.110.0040.01117.05
7.2.100.0000.01316.89
7.2.90.0140.00017.00
7.2.80.0030.00716.83
7.2.70.0030.01216.68
7.2.60.0100.00617.04
7.2.50.0080.00017.01
7.2.40.0030.01417.20
7.2.30.0070.00417.12
7.2.20.0070.00417.09
7.2.10.0000.01317.18
7.2.00.0060.00418.29
7.1.250.0100.00316.05
7.1.200.0070.00715.76
7.1.100.0080.00817.99
7.1.70.0050.00317.32
7.1.60.0130.01019.48
7.1.50.0030.00716.92
7.1.00.0070.07322.33
7.0.200.0130.00714.88
7.0.60.0030.08019.86
7.0.50.0100.03717.88
7.0.40.0100.09020.30
7.0.30.0270.05020.30
7.0.20.0300.07320.09
7.0.10.0070.05720.13
7.0.00.0130.04720.16
5.6.280.0000.06021.04
5.6.210.0100.07320.72
5.6.200.0130.05018.22
5.6.190.0170.03720.50
5.6.180.0170.04320.64
5.6.170.0170.08020.62
5.6.160.0170.03020.46
5.6.150.0130.04318.30
5.6.140.0070.08718.16
5.6.130.0130.07018.15
5.6.120.0100.03721.00
5.6.110.0070.08320.99
5.6.100.0170.06021.01
5.6.90.0070.07721.00
5.6.80.0130.07320.32
5.5.350.0100.02720.43
5.5.340.0000.05317.97
5.5.330.0070.06020.47
5.5.320.0030.04020.41
5.5.310.0170.04720.27
5.5.300.0030.08717.98
5.5.290.0030.05718.02
5.5.280.0030.07720.80
5.5.270.0200.07320.88
5.5.260.0070.07321.00
5.5.250.0070.06720.79
5.5.240.0170.06720.14

preferences:
39.31 ms | 400 KiB | 5 Q