3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author: hakre <http://hakre.wordpress.com> * @link http://stackoverflow.com/a/17628617/367456 */ /** * dereference a value and optionally setting its type * * @param mixed $mixed * @param null $type (optional) * * @return mixed $mixed set as $type */ function rettype($mixed, $type = NULL) { $type === NULL || settype($mixed, $type); return $mixed; } $array = Array('status' => 'Figure A. ...', 'numero' => 1); echo rettype($array, 'object')->status; // prints "Figure A. ..."

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.0120.00616.63
8.3.50.0100.00721.97
8.3.40.0110.00418.52
8.3.30.0060.00918.92
8.3.20.0000.00820.22
8.3.10.0070.00023.70
8.3.00.0050.00319.26
8.2.180.0120.00616.50
8.2.170.0090.00622.96
8.2.160.0070.00720.57
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0160.00020.72
8.2.110.0000.01021.01
8.2.100.0090.00317.72
8.2.90.0050.00319.07
8.2.80.0040.00417.97
8.2.70.0030.00617.38
8.2.60.0040.00418.04
8.2.50.0040.00418.10
8.2.40.0110.00018.09
8.2.30.0000.00818.11
8.2.20.0000.00717.54
8.2.10.0050.00218.08
8.2.00.0080.00017.59
8.1.280.0120.00625.92
8.1.270.0080.00023.91
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00623.92
8.1.230.0040.00717.64
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0040.00417.25
8.1.190.0030.00617.22
8.1.180.0080.00018.10
8.1.170.0040.00418.50
8.1.160.0000.00721.93
8.1.150.0040.00418.52
8.1.140.0000.00817.37
8.1.130.0040.00417.87
8.1.120.0080.00017.39
8.1.110.0030.00317.36
8.1.100.0030.00517.45
8.1.90.0030.00317.47
8.1.80.0000.00817.45
8.1.70.0000.00717.41
8.1.60.0000.00817.64
8.1.50.0000.00817.45
8.1.40.0030.00517.47
8.1.30.0040.00417.54
8.1.20.0000.00717.65
8.1.10.0040.00417.55
8.1.00.0070.00017.50
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0070.00018.48
8.0.270.0040.00417.17
8.0.260.0030.00317.22
8.0.250.0030.00316.96
8.0.240.0060.00016.83
8.0.230.0000.00616.97
8.0.220.0040.00416.79
8.0.210.0050.00216.86
8.0.200.0030.00516.83
8.0.190.0000.00816.98
8.0.180.0090.00316.84
8.0.170.0000.00716.96
8.0.160.0030.00516.88
8.0.150.0040.00416.75
8.0.140.0040.00416.87
8.0.130.0030.00313.31
8.0.120.0000.00816.89
8.0.110.0030.00516.89
8.0.100.0070.00016.80
8.0.90.0030.00516.77
8.0.80.0100.00616.85
8.0.70.0030.00516.77
8.0.60.0000.00716.92
8.0.50.0000.00716.94
8.0.30.0060.01417.07
8.0.20.0090.01517.40
8.0.10.0000.00716.97
8.0.00.0130.01216.82
7.4.330.0030.00315.00
7.4.320.0030.00316.47
7.4.300.0030.00316.57
7.4.290.0070.00016.49
7.4.280.0000.00816.59
7.4.270.0000.00716.53
7.4.260.0030.00316.51
7.4.250.0000.00816.48
7.4.240.0060.00116.59
7.4.230.0070.00016.64
7.4.220.0090.00916.53
7.4.210.0070.01116.65
7.4.200.0070.00016.70
7.4.190.0040.00416.77
7.4.160.0160.00016.29
7.4.150.0100.00717.40
7.4.140.0080.00917.86
7.4.130.0090.00816.50
7.4.120.0090.01016.55
7.4.110.0100.00716.43
7.4.100.0120.00616.59
7.4.90.0090.00916.49
7.4.80.0140.00419.39
7.4.70.0120.00316.51
7.4.60.0060.01016.49
7.4.50.0030.00616.51
7.4.40.0060.01016.29
7.4.30.0070.01516.67
7.4.00.0030.01314.78
7.3.330.0060.00013.31
7.3.320.0030.00313.07
7.3.310.0070.00016.41
7.3.300.0070.00016.27
7.3.290.0060.01316.27
7.3.280.0100.00716.32
7.3.270.0170.00017.40
7.3.260.0170.00016.37
7.3.250.0100.00916.55
7.3.240.0160.01516.41
7.3.230.0070.01016.65
7.3.210.0140.00316.50
7.3.200.0070.01019.39
7.3.190.0030.01316.57
7.3.180.0040.01116.54
7.3.170.0100.00716.57
7.3.160.0100.00716.49
7.3.120.0110.00414.68
7.2.330.0040.01516.61
7.2.320.0080.00916.73
7.2.310.0100.00716.61
7.2.300.0130.00316.57
7.2.290.0160.00616.74
7.1.70.0030.00717.22
7.1.60.0110.01419.70
7.1.50.0070.01516.95
7.1.00.0100.07022.41
7.0.200.0030.00716.75
7.0.140.0030.07322.04
7.0.60.0070.06720.08
7.0.50.0100.07717.89
7.0.40.0130.04320.38
7.0.30.0230.06720.19
7.0.20.0170.04020.30
7.0.10.0070.08320.23
7.0.00.0100.04720.09
5.6.280.0070.07021.12
5.6.210.0070.07720.55
5.6.200.0100.06018.19
5.6.190.0030.08320.64
5.6.180.0300.04320.65
5.6.170.0270.05320.71
5.6.160.0100.08320.58
5.6.150.0000.04318.18
5.6.140.0070.08318.27
5.6.130.0070.07018.20
5.6.120.0070.08021.15
5.6.110.0030.08021.00
5.6.100.0070.08021.02
5.6.90.0030.06721.01
5.6.80.0130.04320.41
5.5.350.0330.06020.32
5.5.340.0030.05018.09
5.5.330.0070.08720.57
5.5.320.0430.06020.33
5.5.310.0370.05720.34
5.5.300.0130.05317.95
5.5.290.0070.05318.00
5.5.280.0030.07020.77
5.5.270.0070.08720.86
5.5.260.0130.08020.89
5.5.250.0230.07020.55
5.5.240.0070.06320.15
5.4.450.0300.07019.49
5.4.440.0230.06319.52
5.4.430.0370.06719.46
5.4.420.0400.04719.18
5.4.410.0300.07319.36
5.4.400.0270.06319.09
5.4.390.0430.05319.31
5.4.380.0300.07319.10
5.4.370.0270.03719.07
5.4.360.0300.06719.14
5.4.350.0300.04718.87
5.4.340.0330.06318.87
5.4.320.0330.05718.85
5.4.310.0300.07319.32
5.4.300.0270.07719.09
5.4.290.0270.06319.08
5.4.280.0230.07719.14
5.4.270.0370.06718.87
5.4.260.0270.04318.99
5.4.250.0230.04719.30
5.4.240.0330.06719.21
5.4.230.0270.05319.07
5.4.220.0300.07019.21
5.4.210.0370.05719.21
5.4.200.0330.06719.06
5.4.190.0230.04318.97
5.4.180.0270.05019.23
5.4.170.0270.04719.21
5.4.160.0370.04019.11
5.4.150.0270.07319.04
5.4.140.0170.05016.50
5.4.130.0270.03316.56
5.4.120.0230.05016.32
5.4.110.0230.05016.58
5.4.100.0370.06016.58
5.4.90.0370.05316.55
5.4.80.0370.03316.23
5.4.70.0430.06016.52
5.4.60.0300.04016.24
5.4.50.0300.04716.34
5.4.40.0270.05716.25
5.4.30.0230.07016.30
5.4.20.0170.08016.37
5.4.10.0200.07316.44
5.4.00.0200.07015.96
5.3.290.0330.05014.81
5.3.280.0230.04314.80
5.3.270.0300.07714.67
5.3.260.0200.04014.53
5.3.250.0270.04314.61
5.3.240.0200.04314.60
5.3.230.0300.05714.49
5.3.220.0400.06014.66
5.3.210.0270.07014.67
5.3.200.0230.06014.64
5.3.190.0300.07014.46
5.3.180.0300.03314.61
5.3.170.0330.07014.57
5.3.160.0330.04014.64
5.3.150.0130.05014.57
5.3.140.0230.04314.55
5.3.130.0300.06314.45
5.3.120.0230.06714.45
5.3.110.0230.07014.55
5.3.100.0230.05014.15
5.3.90.0500.03014.09
5.3.80.0330.06014.10
5.3.70.0300.06713.93
5.3.60.0300.04014.02
5.3.50.0330.05713.86
5.3.40.0270.04713.92
5.3.30.0370.06313.82
5.3.20.0370.05713.69
5.3.10.0400.06013.81
5.3.00.0370.03713.86
5.2.170.0230.03313.21
5.2.160.0170.03013.21
5.2.150.0230.05713.21
5.2.140.0370.05013.21
5.2.130.0370.04313.21
5.2.120.0230.06013.21
5.2.110.0270.06013.21
5.2.100.0130.04313.21
5.2.90.0330.02713.21
5.2.80.0200.04313.21
5.2.70.0230.06313.21
5.2.60.0230.04713.21
5.2.50.0200.06313.21
5.2.40.0170.05713.21
5.2.30.0170.06313.21
5.2.20.0170.05313.21
5.2.10.0270.04713.21
5.2.00.0100.03313.21
5.1.60.0170.03313.21
5.1.50.0200.05013.21
5.1.40.0230.04713.21
5.1.30.0200.03313.21
5.1.20.0300.04713.21
5.1.10.0200.02313.21
5.1.00.0100.03013.21
5.0.50.0030.02313.21
5.0.40.0130.03713.21
5.0.30.0130.02713.21
5.0.20.0030.04713.21
5.0.10.0100.03313.21
5.0.00.0130.05313.21
4.4.90.0130.03013.21
4.4.80.0130.03313.21
4.4.70.0170.02713.21
4.4.60.0100.03713.21
4.4.50.0130.03013.21
4.4.40.0100.04013.21
4.4.30.0100.03713.21
4.4.20.0100.02013.21
4.4.10.0070.01713.21
4.4.00.0070.03713.21
4.3.110.0100.02713.21
4.3.100.0170.02013.21
4.3.90.0070.03013.21
4.3.80.0170.03313.21
4.3.70.0100.03313.21
4.3.60.0100.03313.21
4.3.50.0100.03313.21
4.3.40.0070.04313.21
4.3.30.0030.03713.21
4.3.20.0000.03313.21
4.3.10.0030.02713.21
4.3.00.0100.03013.21

preferences:
36.98 ms | 400 KiB | 5 Q