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. ...'); 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.4.10.0070.01317.50
8.3.140.0090.00616.62
8.3.130.0000.00916.73
8.3.120.0070.01018.94
8.3.110.0070.00420.94
8.3.100.0050.00324.06
8.3.90.0110.00726.77
8.3.80.0000.00916.75
8.3.70.0120.00616.58
8.3.60.0100.00716.73
8.3.50.0130.00321.99
8.3.40.0070.00718.55
8.3.30.0180.00419.09
8.3.20.0080.00020.13
8.3.10.0080.00023.65
8.3.00.0030.00519.55
8.2.250.0080.00019.23
8.2.240.0130.00617.04
8.2.230.0040.00422.58
8.2.220.0030.00637.54
8.2.210.0070.00726.77
8.2.200.0030.00616.50
8.2.190.0170.00316.63
8.2.180.0120.00318.29
8.2.170.0110.01118.86
8.2.160.0030.01022.25
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0110.00017.75
8.2.110.0070.00821.62
8.2.100.0050.01119.40
8.2.90.0160.00418.34
8.2.80.0160.00219.05
8.2.70.0120.00638.42
8.2.60.0130.00438.67
8.2.50.0160.00638.72
8.2.40.0080.00633.47
8.2.30.0100.00733.43
8.2.20.0090.00433.38
8.2.10.0100.00433.45
8.2.00.0110.00333.38
8.1.300.0040.00420.32
8.1.290.0000.00818.88
8.1.280.0190.00025.92
8.1.270.0090.00723.28
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00419.75
8.1.230.0160.00519.80
8.1.220.0120.00618.18
8.1.210.0080.00719.41
8.1.200.0090.00838.34
8.1.190.0100.00734.23
8.1.180.0080.00838.52
8.1.170.0110.00433.45
8.1.160.0090.00533.64
8.1.150.0050.00834.00
8.1.140.0070.00633.24
8.1.130.0070.00633.23
8.1.120.0050.00833.27
8.1.110.0090.00433.22
8.1.100.0130.00133.27
8.1.90.0100.00433.26
8.1.80.0080.00533.25
8.1.70.0080.00533.28
8.1.60.0110.00433.28
8.1.50.0110.00433.22
8.1.40.0120.00433.29
8.1.30.0130.00133.37
8.1.20.0110.00333.37
8.1.10.0110.00233.28
8.1.00.0080.00533.26
8.0.300.0110.00620.90
8.0.290.0100.00337.94
8.0.280.0070.00633.28
8.0.270.0080.00532.91
8.0.260.0080.00532.92
8.0.250.0110.00332.95
8.0.240.0090.00432.93
8.0.230.0100.00333.05
8.0.220.0100.00432.88
8.0.210.0100.00332.80
8.0.200.0080.00532.93
8.0.190.0090.00532.97
8.0.180.0100.00432.92
8.0.170.0110.00432.92
8.0.160.0110.00332.93
8.0.150.0070.00732.85
8.0.140.0090.00532.93
8.0.130.0110.00432.03
8.0.120.0140.00332.84
8.0.110.0100.00332.96
8.0.100.0130.00132.93
8.0.90.0100.00332.87
8.0.80.0130.00332.89
8.0.70.0090.00532.88
8.0.60.0100.00432.91
8.0.50.0080.00532.94
8.0.30.0120.00429.90
8.0.20.0110.00627.77
8.0.10.0130.00432.95
8.0.00.0090.00924.36
7.4.330.0100.00427.38
7.4.320.0090.00532.79
7.4.300.0040.00733.23
7.4.290.0100.00232.75
7.4.280.0130.00232.74
7.4.270.0120.00332.73
7.4.260.0070.00632.73
7.4.250.0070.00532.73
7.4.240.0050.00529.52
7.4.230.0090.00632.67
7.4.220.0100.00632.76
7.4.210.0070.00625.83
7.4.200.0100.00132.73
7.4.190.0110.00738.14
7.4.180.0090.00338.15
7.4.160.0090.00532.72
7.4.150.0100.00529.68
7.4.140.0110.00729.68
7.4.130.0110.00823.68
7.4.120.0110.00823.68
7.4.110.0140.00724.61
7.4.100.0120.00724.62
7.4.90.0130.00824.52
7.4.80.0150.00524.94
7.4.70.0120.00824.60
7.4.60.0120.00824.56
7.4.50.0090.00724.49
7.4.40.0130.00824.61
7.4.30.0120.00824.56
7.4.20.0130.00625.71
7.4.10.0100.00925.67
7.4.00.0110.00724.37
7.3.330.0110.00531.89
7.3.320.0140.00131.85
7.3.310.0110.00432.65
7.3.300.0140.00232.63
7.3.290.0130.00332.64
7.3.280.0110.00827.20
7.3.270.0090.01029.60
7.3.260.0160.00629.37
7.3.250.0140.00623.60
7.3.240.0120.00724.45
7.3.230.0120.00824.47
7.3.220.0140.00425.79
7.3.210.0120.00824.47
7.3.200.0100.00924.87
7.3.190.0100.00824.59
7.3.180.0120.00724.57
7.3.170.0120.00624.53
7.3.160.0120.00624.52
7.3.150.0140.00825.66
7.3.140.0110.00825.65
7.3.130.0160.00625.73
7.3.120.0120.00724.30
7.3.110.0130.00424.26
7.3.100.0120.00824.38
7.3.90.0080.00924.38
7.3.80.0120.00623.28
7.3.70.0110.00621.13
7.3.60.0130.00721.13
7.3.50.0120.00721.08
7.3.40.0120.00721.06
7.3.30.0120.00621.09
7.3.20.0150.00621.44
7.3.10.0140.00821.46
7.3.00.0140.00521.45
7.2.340.0150.00926.06
7.2.330.0140.00924.64
7.2.320.0130.01024.65
7.2.310.0150.01024.68
7.2.300.0150.00724.66
7.2.290.0190.00624.68
7.2.280.0190.00725.71
7.2.270.0200.00625.73
7.2.260.0170.00925.84
7.2.250.0160.00925.87
7.2.240.0170.00724.52
7.2.230.0160.00924.46
7.2.220.0180.00624.42
7.2.210.0160.00623.34
7.2.200.0150.00721.25
7.2.190.0150.00721.27
7.2.180.0140.00621.31
7.2.170.0130.00821.28
7.2.160.0140.00821.30
7.2.150.0150.00721.81
7.2.140.0240.00621.67
7.2.130.0140.00921.61
7.2.120.0150.00821.60
7.2.110.0180.00721.72
7.2.100.0160.00821.67
7.2.90.0140.00821.55
7.2.80.0160.00721.64
7.2.70.0160.00721.64
7.2.60.0160.00721.63
7.2.50.0190.00821.68
7.2.40.0170.00621.66
7.2.30.0180.00621.66
7.2.20.0190.00621.67
7.2.10.0140.00921.69
7.2.00.0130.00721.60
7.1.330.0130.00823.94
7.1.320.0150.00723.96
7.1.310.0130.00723.03
7.1.300.0140.00820.75
7.1.290.0150.00820.75
7.1.280.0150.00820.73
7.1.270.0130.00820.66
7.1.260.0200.00720.70
7.1.250.0150.00720.69
7.1.240.0150.00720.71
7.1.230.0240.00820.67
7.1.220.0160.00520.70
7.1.210.0150.00720.66
7.1.200.0170.00720.74
7.1.190.0150.00720.65
7.1.180.0160.00720.71
7.1.170.0160.00620.74
7.1.160.0160.01020.67
7.1.150.0140.00820.71
7.1.140.0160.00620.68
7.1.130.0160.00720.62
7.1.120.0160.00620.69
7.1.110.0160.00720.73
7.1.100.0170.00720.73
7.1.90.0140.00720.74
7.1.80.0190.00720.67
7.1.70.0150.00720.73
7.1.60.0190.00620.71
7.1.50.0170.00620.72
7.1.40.0170.00820.68
7.1.30.0150.00820.67
7.1.20.0170.00720.71
7.1.10.0180.00620.54
7.1.00.0210.00820.56
7.0.330.0200.00820.36
7.0.320.0180.00520.37
7.0.310.0180.00720.28
7.0.300.0140.00720.30
7.0.290.0170.00620.33
7.0.280.0200.00820.32
7.0.270.0150.00620.34
7.0.260.0110.01020.31
7.0.250.0210.00820.41
7.0.240.0150.00620.37
7.0.230.0140.00820.37
7.0.220.0150.00720.35
7.0.210.0160.00720.39
7.0.200.0140.00820.34
7.0.190.0130.00920.35
7.0.180.0140.00720.42
7.0.170.0130.00820.38
7.0.160.0150.00620.35
7.0.150.0200.00820.20
7.0.140.0180.00620.21
7.0.130.0140.00720.22
7.0.120.0180.00620.38
7.0.110.0170.00620.39
7.0.100.0160.00820.40
7.0.90.0150.00720.29
7.0.80.0150.00720.40
7.0.70.0140.00820.34
7.0.60.0140.00720.30
7.0.50.0180.00620.38
7.0.40.0190.00720.41
7.0.30.0160.00720.38
7.0.20.0150.00820.42
7.0.10.0190.00620.41
7.0.00.0160.00720.36
5.6.400.0140.00920.79
5.6.390.0140.01020.82
5.6.380.0160.00820.62
5.6.370.0160.00720.75
5.6.360.0150.00820.81
5.6.350.0150.00720.70
5.6.340.0140.00920.67
5.6.330.0120.00920.70
5.6.320.0130.00820.74
5.6.310.0140.00720.70
5.6.300.0130.00820.60
5.6.290.0140.00620.71
5.6.280.0120.00920.73
5.6.270.0140.00820.76
5.6.260.0160.00720.71
5.6.250.0140.00720.69
5.6.240.0120.01020.69
5.6.230.0130.00920.71
5.6.220.0140.00820.72
5.6.210.0140.00820.75
5.6.200.0160.00720.67
5.6.190.0120.01020.72
5.6.180.0200.00520.73
5.6.170.0140.00920.70
5.6.160.0140.00720.70
5.6.150.0120.01020.71
5.6.140.0160.00720.74
5.6.130.0140.00820.74
5.6.120.0140.00920.69
5.6.110.0140.00820.70
5.6.100.0150.00920.73
5.6.90.0130.00820.70
5.6.80.0120.00820.61
5.6.70.0130.00820.62
5.6.60.0140.00920.61
5.6.50.0140.00820.63
5.6.40.0140.00820.69
5.6.30.0130.00820.63
5.6.20.0140.00820.66
5.6.10.0120.00920.59
5.6.00.0130.00820.58
5.5.380.0170.00720.64
5.5.370.0130.00820.68
5.5.360.0150.00720.64
5.5.350.0140.00920.65
5.5.340.0160.00820.65
5.5.330.0150.00820.64
5.5.320.0150.00720.63
5.5.310.0150.00820.73
5.5.300.0130.01020.67
5.5.290.0130.00920.71
5.5.280.0140.00920.65
5.5.270.0140.00920.65
5.5.260.0150.00720.75
5.5.250.0130.01020.65
5.5.240.0150.00720.59
5.5.230.0140.00620.56
5.5.220.0110.00920.58
5.5.210.0140.00820.63
5.5.200.0120.00820.51
5.5.190.0140.00620.59
5.5.180.0120.00920.56
5.5.170.0160.00720.61
5.5.160.0140.00920.60
5.5.150.0130.00820.61
5.5.140.0160.00820.60
5.5.130.0120.01020.60
5.5.120.0120.01020.59
5.5.110.0140.00920.60
5.5.100.0130.00920.55
5.5.90.0140.00720.68
5.5.80.0110.01020.58
5.5.70.0140.00720.59
5.5.60.0130.00720.66
5.5.50.0120.00720.66
5.5.40.0130.00720.58
5.5.30.0120.00920.61
5.5.20.0120.00920.64
5.5.10.0120.00820.61
5.5.00.0120.00819.82
5.4.450.0090.00718.30
5.4.440.0120.00618.26
5.4.430.0100.00618.33
5.4.420.0090.00618.27
5.4.410.0100.00618.27
5.4.400.0110.00418.25
5.4.390.0110.00418.29
5.4.380.0110.00518.26
5.4.370.0100.00618.28
5.4.360.0120.00518.23
5.4.350.0100.00518.25
5.4.340.0090.00618.29
5.4.330.0100.00718.23
5.4.320.0110.00618.24
5.4.310.0100.00518.29
5.4.300.0100.00718.27
5.4.290.0110.00618.31
5.4.280.0110.00518.26
5.4.270.0090.00718.21
5.4.260.0110.00518.26
5.4.250.0110.00718.27
5.4.240.0090.00618.21
5.4.230.0120.00518.25
5.4.220.0110.00518.24
5.4.210.0100.00618.20
5.4.200.0120.00518.28
5.4.190.0100.00518.25
5.4.180.0110.00418.26
5.4.170.0090.00517.69
5.4.160.0090.00617.69
5.4.150.0120.00317.68
5.4.140.0090.00617.76
5.4.130.0090.00617.73
5.4.120.0110.00417.72
5.4.110.0080.00717.74
5.4.100.0090.00617.70
5.4.90.0100.00417.72
5.4.80.0100.00517.75
5.4.70.0090.00517.75
5.4.60.0090.00717.72
5.4.50.0090.00617.69
5.4.40.0100.00617.74
5.4.30.0080.00617.73
5.4.20.0110.00517.73
5.4.10.0100.00517.72
5.4.00.0110.00417.75
5.3.290.0100.00718.34
5.3.280.0090.00718.29
5.3.270.0110.00517.72
5.3.260.0090.00717.75
5.3.250.0090.00717.74
5.3.240.0090.00717.64
5.3.230.0090.00717.67
5.3.220.0110.00517.65
5.3.210.0110.00617.64
5.3.200.0090.00717.66
5.3.190.0120.00417.65
5.3.180.0100.00517.75
5.3.170.0100.00517.77
5.3.160.0100.00617.73
5.3.150.0110.00517.72
5.3.140.0100.00617.71
5.3.130.0130.00417.69
5.3.120.0090.00717.72
5.3.110.0110.00517.71
5.3.100.0110.00517.73
5.3.90.0100.00617.74
5.3.80.0100.00517.69
5.3.70.0080.00517.64
5.3.60.0110.00417.78
5.3.50.0090.00717.66
5.3.40.0090.00617.70
5.3.30.0090.00517.76
5.3.20.0100.00517.73
5.3.10.0100.00617.64
5.3.00.0100.00517.62

preferences:
24.14 ms | 403 KiB | 5 Q