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(badger)) ?>

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.0150.00016.75
8.3.50.0070.01422.00
8.3.40.0000.01518.79
8.3.30.0150.00018.79
8.3.20.0000.00820.34
8.3.10.0040.00423.66
8.3.00.0060.00319.38
8.2.180.0070.01118.54
8.2.170.0090.00622.96
8.2.160.0100.00720.52
8.2.150.0090.00024.18
8.2.140.0090.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00321.02
8.2.110.0030.00620.43
8.2.100.0110.00017.80
8.2.90.0000.00819.23
8.2.80.0050.00317.97
8.2.70.0050.00317.48
8.2.60.0040.00418.03
8.2.50.0050.00318.07
8.2.40.0030.00519.39
8.2.30.0000.00720.62
8.2.20.0030.00617.78
8.2.10.0030.00618.15
8.2.00.0000.00818.10
8.1.280.0070.01125.92
8.1.270.0050.00523.57
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0040.00422.19
8.1.230.0000.01117.54
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0000.00817.22
8.1.180.0000.00818.10
8.1.170.0000.00818.70
8.1.160.0030.00522.07
8.1.150.0040.00418.86
8.1.140.0000.01019.54
8.1.130.0030.00317.64
8.1.120.0000.00817.43
8.1.110.0030.00517.45
8.1.100.0050.00217.44
8.1.90.0040.00417.45
8.1.80.0060.00317.42
8.1.70.0000.00717.36
8.1.60.0050.00317.48
8.1.50.0080.00017.51
8.1.40.0070.00417.37
8.1.30.0040.00417.68
8.1.20.0040.00417.59
8.1.10.0040.00417.44
8.1.00.0040.00417.37
8.0.300.0000.00818.77
8.0.290.0030.00616.88
8.0.280.0040.00418.53
8.0.270.0040.00317.31
8.0.260.0000.00617.28
8.0.250.0070.00017.07
8.0.240.0070.00016.99
8.0.230.0030.00517.07
8.0.220.0040.00417.01
8.0.210.0070.00016.98
8.0.200.0060.00017.04
8.0.190.0040.00417.02
8.0.180.0050.00316.88
8.0.170.0000.00816.91
8.0.160.0050.00317.07
8.0.150.0070.00016.93
8.0.140.0080.00016.86
8.0.130.0030.00313.41
8.0.120.0000.00816.97
8.0.110.0000.00816.95
8.0.100.0000.00816.84
8.0.90.0040.00416.89
8.0.80.0060.01016.95
8.0.70.0000.00716.93
8.0.60.0040.00416.82
8.0.50.0050.00216.80
8.0.30.0100.00717.16
8.0.20.0120.01417.40
8.0.10.0040.00417.12
8.0.00.0070.01116.91
7.4.330.0050.00016.77
7.4.320.0000.00616.65
7.4.300.0060.00016.63
7.4.290.0070.00016.62
7.4.280.0030.00916.70
7.4.270.0030.00316.71
7.4.260.0000.00716.61
7.4.250.0000.00816.67
7.4.240.0000.00716.60
7.4.230.0000.00716.66
7.4.220.0080.01216.53
7.4.210.0070.01416.55
7.4.200.0030.00316.44
7.4.160.0090.00616.82
7.4.150.0110.00717.40
7.4.140.0190.01017.86
7.4.130.0110.00716.59
7.4.120.0120.00616.73
7.4.110.0100.01016.66
7.4.100.0060.01616.68
7.4.90.0120.00616.64
7.4.80.0100.00719.39
7.4.70.0030.01416.70
7.4.60.0070.01016.70
7.4.50.0070.01016.55
7.4.40.0060.01016.85
7.4.30.0080.00916.82
7.4.10.0040.01314.98
7.4.00.0070.01115.14
7.3.330.0050.00013.60
7.3.320.0050.00013.60
7.3.310.0000.00716.39
7.3.300.0020.00516.54
7.3.290.0090.00716.53
7.3.280.0110.00716.49
7.3.270.0100.00717.40
7.3.260.0130.00616.51
7.3.250.0110.00716.61
7.3.240.0030.01416.59
7.3.230.0120.00616.73
7.3.210.0170.00716.79
7.3.200.0070.01116.69
7.3.190.0030.01716.77
7.3.180.0040.01116.83
7.3.170.0120.01016.68
7.3.160.0040.01316.68
7.3.130.0140.00414.97
7.3.120.0110.00614.98
7.3.110.0090.00814.99
7.3.100.0090.00915.14
7.3.90.0060.00915.04
7.3.80.0050.01215.13
7.3.70.0070.00914.87
7.3.60.0030.01114.77
7.3.50.0030.01014.98
7.3.40.0060.00715.02
7.3.30.0050.01115.00
7.3.20.0070.00916.77
7.3.10.0080.00516.70
7.3.00.0030.01616.79
7.2.330.0130.00316.88
7.2.320.0100.01316.64
7.2.310.0110.00816.84
7.2.300.0130.00617.05
7.2.290.0060.01616.86
7.2.260.0040.01115.48
7.2.250.0090.00814.94
7.2.240.0110.00815.19
7.2.230.0050.01314.88
7.2.220.0070.01015.18
7.2.210.0080.00715.35
7.2.200.0060.00815.29
7.2.190.0050.01215.12
7.2.180.0030.01315.06
7.2.170.0060.00815.29
7.2.160.0050.01114.85
7.2.150.0070.00917.14
7.2.140.0070.00616.77
7.2.130.0070.00916.96
7.2.120.0030.01016.78
7.2.110.0100.00516.68
7.2.100.0050.00816.94
7.2.90.0050.00916.92
7.2.80.0020.01317.01
7.2.70.0060.00917.02
7.2.60.0090.00517.00
7.2.50.0080.00916.87
7.2.40.0030.01217.11
7.2.30.0060.00817.14
7.2.20.0070.00417.07
7.2.10.0060.00816.91
7.2.00.0070.00716.93
7.1.330.0110.00315.98
7.1.320.0080.00715.94
7.1.310.0110.00616.02
7.1.300.0080.00915.84
7.1.290.0050.01015.80
7.1.280.0020.01215.89
7.1.270.0080.00815.86
7.1.260.0020.00915.90
7.1.250.0060.00915.80
7.1.240.0090.00715.78
7.1.230.0090.00815.84
7.1.220.0060.00815.90
7.1.210.0040.01215.73
7.1.200.0130.00815.75
7.1.190.0070.00815.76
7.1.180.0050.00815.69
7.1.170.0030.01115.99
7.1.160.0080.00415.73
7.1.150.0080.00515.98
7.1.140.0080.00715.93
7.1.130.0060.00615.85
7.1.120.0080.00515.78
7.1.110.0050.00915.91
7.1.100.0050.00815.78
7.1.90.0070.00815.85
7.1.80.0050.00915.97
7.1.70.0060.00716.42
7.1.60.0090.00817.03
7.1.50.0050.01116.07
7.1.40.0060.00915.89
7.1.30.0070.00915.81
7.1.20.0020.01315.71
7.1.10.0060.00915.90
7.1.00.0070.03117.99
7.0.330.0060.00615.49
7.0.320.0060.01015.24
7.0.310.0060.00915.32
7.0.300.0110.00315.57
7.0.290.0070.00815.43
7.0.280.0050.00615.49
7.0.270.0040.01115.52
7.0.260.0070.00615.55
7.0.250.0080.00415.42
7.0.240.0110.00415.47
7.0.230.0030.01215.68
7.0.220.0050.00815.52
7.0.210.0100.00515.56
7.0.200.0060.00915.34
7.0.190.0080.00715.58
7.0.180.0070.00615.54
7.0.170.0070.00515.58
7.0.160.0060.00815.40
7.0.150.0050.01115.67
7.0.140.0060.00615.52
7.0.130.0060.01015.59
7.0.120.0070.00615.54
7.0.110.0080.00815.46
7.0.100.0050.00915.32
7.0.90.0090.00615.39
7.0.80.0050.01115.56
7.0.70.0070.00615.46
7.0.60.0030.02117.06
7.0.50.0060.02616.29
7.0.40.0090.03315.83
7.0.30.0140.02915.67
7.0.20.0120.01815.74
7.0.10.0060.03315.78
7.0.00.0090.02415.66
5.6.400.0060.00914.59
5.6.390.0080.00614.63
5.6.380.0030.00914.45
5.6.370.0080.00514.50
5.6.360.0030.01114.61
5.6.350.0050.00914.55
5.6.340.0080.00314.48
5.6.330.0050.01114.49
5.6.320.0110.00514.27
5.6.310.0060.00814.52
5.6.300.0120.00414.66
5.6.290.0060.00614.28
5.6.280.0060.01616.65
5.6.270.0080.00714.40
5.6.260.0110.00414.30
5.6.250.0020.01014.59
5.6.240.0080.00614.40
5.6.230.0060.00914.28
5.6.220.0030.00914.34
5.6.210.0060.03216.55
5.6.200.0040.03415.63
5.6.190.0080.02116.41
5.6.180.0120.01716.34
5.6.170.0140.01916.48
5.6.160.0060.01816.48
5.6.150.0070.02215.70
5.6.140.0030.02115.63
5.6.130.0050.02515.69
5.6.120.0040.02116.46
5.6.110.0060.01916.63
5.6.100.0090.03016.61
5.6.90.0080.03316.58
5.6.80.0040.03116.28
5.6.70.0070.00714.47
5.6.60.0070.00814.27
5.6.50.0100.00714.31
5.6.40.0070.00914.46
5.6.30.0050.01014.32
5.6.20.0090.00514.38
5.6.10.0080.00714.36
5.6.00.0070.00714.39
5.5.380.0060.01114.23
5.5.370.0060.00914.36
5.5.360.0020.01414.23
5.5.350.0730.02316.50
5.5.340.0050.02815.45
5.5.330.0010.02516.39
5.5.320.0050.01816.21
5.5.310.0110.02016.38
5.5.300.0080.03115.61
5.5.290.0030.03015.55
5.5.280.0050.03616.49
5.5.270.0060.03016.44
5.5.260.0090.02116.49
5.5.250.0100.02616.40
5.5.240.0080.03216.31
5.5.230.0050.00714.12
5.5.220.0060.00714.14
5.5.210.0050.01014.36
5.5.200.0110.00114.03
5.5.190.0070.00714.29
5.5.180.0040.00914.38
5.5.170.0050.00914.20
5.5.160.0020.01214.03
5.5.150.0080.00514.25
5.5.140.0030.00814.25
5.5.130.0020.01014.23
5.5.120.0070.00714.11
5.5.110.0100.00314.30
5.5.100.0040.01314.26
5.5.90.0080.00514.26
5.5.80.0040.01014.15
5.5.70.0060.01114.21
5.5.60.0020.01314.26
5.5.50.0080.00714.36
5.5.40.0070.00914.40
5.5.30.0020.01014.13
5.5.20.0040.00914.18
5.5.10.0060.00613.80
5.5.00.0040.00914.19

preferences:
45.75 ms | 401 KiB | 5 Q