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.1.90.0070.00017.47
8.1.80.0000.00717.50
8.1.70.0000.00817.38
8.1.60.0080.00417.50
8.1.50.0080.00017.42
8.1.40.0000.00917.56
8.1.30.0080.00017.61
8.1.20.0030.00517.71
8.1.10.0040.00417.42
8.1.00.0040.00417.48
8.0.220.0030.00316.78
8.0.210.0040.00416.73
8.0.200.0030.00316.83
8.0.190.0040.00417.00
8.0.180.0000.00716.80
8.0.170.0000.00716.85
8.0.160.0050.00316.95
8.0.150.0050.00316.77
8.0.140.0080.00016.90
8.0.130.0050.00013.29
8.0.120.0050.00316.77
8.0.110.0070.00016.91
8.0.100.0050.00316.86
8.0.90.0050.00216.77
8.0.80.0110.00816.88
8.0.70.0000.00716.73
8.0.60.0030.00616.87
8.0.50.0040.00416.93
8.0.30.0120.00817.12
8.0.20.0110.00717.22
8.0.10.0170.00316.90
8.0.00.0080.01116.75
7.4.300.0000.00616.54
7.4.290.0070.00016.67
7.4.280.0000.00716.55
7.4.270.0030.00516.59
7.4.260.0030.00716.42
7.4.250.0030.00516.53
7.4.240.0020.00516.56
7.4.230.0000.00716.35
7.4.220.0110.00616.55
7.4.210.0060.00716.57
7.4.200.0070.00016.51
7.4.160.0110.00516.48
7.4.150.0130.00616.91
7.4.140.0120.01017.12
7.4.130.0110.00916.48
7.4.120.0090.01216.44
7.4.110.0110.01016.52
7.4.100.0130.00916.50
7.4.90.0110.01016.39
7.4.80.0120.00817.05
7.4.70.0100.01016.47
7.4.60.0110.00916.40
7.4.50.0080.00816.31
7.4.40.0120.00816.57
7.4.30.0090.01116.49
7.4.20.0110.00916.46
7.4.10.0090.01316.34
7.4.00.0120.00816.12
7.3.330.0000.00613.38
7.3.320.0050.00013.34
7.3.310.0000.00716.17
7.3.300.0070.00016.32
7.3.290.0030.00316.37
7.3.280.0080.01016.29
7.3.270.0050.01316.94
7.3.260.0140.00816.38
7.3.250.0110.00716.38
7.3.240.0090.01016.31
7.3.230.0110.00916.34
7.3.220.0130.00616.55
7.3.210.0130.00816.33
7.3.200.0110.01016.95
7.3.190.0080.01216.48
7.3.180.0120.00816.49
7.3.170.0110.00716.43
7.3.160.0100.00816.42
7.3.150.0100.01216.41
7.3.140.0120.00816.36
7.3.130.0130.00816.50
7.3.120.0090.01016.14
7.3.110.0130.00516.01
7.3.100.0100.01016.24
7.3.90.0070.01116.10
7.3.80.0110.00815.91
7.3.70.0100.00715.49
7.3.60.0120.00815.45
7.3.50.0110.00915.42
7.3.40.0120.00715.37
7.3.30.0100.00715.43
7.3.20.0130.00715.70
7.3.10.0130.00915.73
7.3.00.0140.00615.71
7.2.340.0190.01116.60
7.2.330.0130.01116.53
7.2.320.0120.01216.57
7.2.310.0150.01116.60
7.2.300.0150.00916.56
7.2.290.0210.00616.64
7.2.280.0210.00916.43
7.2.270.0210.00916.48
7.2.260.0190.01116.65
7.2.250.0160.01216.64
7.2.240.0180.00816.35
7.2.230.0140.01316.30
7.2.220.0180.00716.18
7.2.210.0160.00815.96
7.2.200.0140.00815.61
7.2.190.0140.00915.64
7.2.180.0140.00715.73
7.2.170.0130.01015.64
7.2.160.0150.00915.68
7.2.150.0160.00715.95
7.2.140.0260.00715.96
7.2.130.0160.01015.89
7.2.120.0170.00815.88
7.2.110.0190.00716.02
7.2.100.0160.00815.99
7.2.90.0130.01015.83
7.2.80.0170.00715.92
7.2.70.0160.00815.92
7.2.60.0160.00815.92
7.2.50.0200.00915.96
7.2.40.0180.00615.93
7.2.30.0180.00615.96
7.2.20.0210.00615.96
7.2.10.0150.00915.85
7.2.00.0130.00815.88
7.1.330.0140.01115.26
7.1.320.0150.00915.28
7.1.310.0130.00715.34
7.1.300.0120.01014.85
7.1.290.0160.00914.86
7.1.280.0160.00814.82
7.1.270.0120.00914.76
7.1.260.0170.00714.78
7.1.250.0140.00914.77
7.1.240.0150.00914.80
7.1.230.0270.00814.80
7.1.220.0170.00614.80
7.1.210.0160.00814.76
7.1.200.0170.00814.85
7.1.190.0160.00714.72
7.1.180.0170.00814.83
7.1.170.0160.00714.72
7.1.160.0170.01114.76
7.1.150.0140.00914.81
7.1.140.0160.00614.79
7.1.130.0160.00814.71
7.1.120.0170.00614.78
7.1.110.0160.00814.86
7.1.100.0190.00714.87
7.1.90.0150.00814.86
7.1.80.0190.00814.76
7.1.70.0160.00814.84
7.1.60.0200.00714.81
7.1.50.0160.00714.83
7.1.40.0170.00814.80
7.1.30.0140.01014.75
7.1.20.0180.00814.80
7.1.10.0190.00614.59
7.1.00.0220.00914.61
7.0.330.0210.00914.39
7.0.320.0180.00614.41
7.0.310.0190.00814.34
7.0.300.0150.00814.31
7.0.290.0170.00714.34
7.0.280.0220.01014.35
7.0.270.0150.00714.36
7.0.260.0110.01214.32
7.0.250.0230.00814.43
7.0.240.0160.00714.41
7.0.230.0130.00914.40
7.0.220.0140.00814.36
7.0.210.0170.00814.43
7.0.200.0130.00914.36
7.0.190.0130.01014.35
7.0.180.0140.00814.45
7.0.170.0140.00814.40
7.0.160.0160.00614.38
7.0.150.0210.00814.18
7.0.140.0180.00714.20
7.0.130.0140.00714.18
7.0.120.0190.00714.41
7.0.110.0180.00714.43
7.0.100.0160.00914.42
7.0.90.0160.00814.32
7.0.80.0160.00714.43
7.0.70.0140.00914.36
7.0.60.0150.00814.30
7.0.50.0200.00714.41
7.0.40.0200.00814.45
7.0.30.0170.00814.43
7.0.20.0170.00714.45
7.0.10.0200.00814.44
7.0.00.0160.00814.41
5.6.400.0140.01015.09
5.6.390.0160.01015.12
5.6.380.0150.01014.87
5.6.370.0150.00915.04
5.6.360.0160.00915.12
5.6.350.0150.00814.95
5.6.340.0130.01114.93
5.6.330.0130.01014.95
5.6.320.0140.01015.03
5.6.310.0160.00814.97
5.6.300.0140.01014.84
5.6.290.0160.00714.96
5.6.280.0130.01015.00
5.6.270.0150.00915.03
5.6.260.0170.00914.98
5.6.250.0170.00714.93
5.6.240.0130.01314.95
5.6.230.0150.01114.94
5.6.220.0150.01014.99
5.6.210.0140.01015.00
5.6.200.0170.00714.91
5.6.190.0140.01214.97
5.6.180.0230.00614.98
5.6.170.0150.01214.95
5.6.160.0140.00914.94
5.6.150.0120.01214.95
5.6.140.0190.00914.99
5.6.130.0170.01015.00
5.6.120.0150.01114.95
5.6.110.0160.01014.96
5.6.100.0170.01015.01
5.6.90.0160.01014.94
5.6.80.0130.01114.84
5.6.70.0140.01014.84
5.6.60.0160.01114.83
5.6.50.0150.01014.89
5.6.40.0160.00914.94
5.6.30.0150.01014.86
5.6.20.0170.00814.91
5.6.10.0130.01014.82
5.6.00.0130.01014.82
5.5.380.0180.00814.89
5.5.370.0140.00914.94
5.5.360.0170.00814.88
5.5.350.0160.01014.90
5.5.340.0170.00914.92
5.5.330.0150.01014.89
5.5.320.0170.00814.88
5.5.310.0160.01015.00
5.5.300.0150.01114.92
5.5.290.0130.01214.96
5.5.280.0150.01014.88
5.5.270.0160.01014.90
5.5.260.0180.00815.02
5.5.250.0140.01114.89
5.5.240.0160.00914.82
5.5.230.0160.00714.79
5.5.220.0120.01114.82
5.5.210.0150.01014.88
5.5.200.0120.01014.75
5.5.190.0150.00814.84
5.5.180.0120.01014.80
5.5.170.0170.00914.85
5.5.160.0150.01014.85
5.5.150.0140.00914.87
5.5.140.0180.01014.85
5.5.130.0130.01214.87
5.5.120.0140.01114.84
5.5.110.0150.01114.86
5.5.100.0150.01014.78
5.5.90.0150.00814.92
5.5.80.0110.01214.84
5.5.70.0160.00814.80
5.5.60.0140.00914.91
5.5.50.0140.00914.90
5.5.40.0150.00914.79
5.5.30.0130.01014.78
5.5.20.0120.01114.89
5.5.10.0140.00914.86
5.5.00.0130.01014.40
5.4.450.0110.00611.82
5.4.440.0130.00811.77
5.4.430.0110.00711.85
5.4.420.0100.00811.78
5.4.410.0120.00711.78
5.4.400.0120.00511.76
5.4.390.0120.00511.81
5.4.380.0120.00611.77
5.4.370.0120.00611.80
5.4.360.0120.00711.73
5.4.350.0120.00611.75
5.4.340.0100.00711.80
5.4.330.0110.00811.72
5.4.320.0120.00711.74
5.4.310.0120.00611.80
5.4.300.0110.00811.78
5.4.290.0120.00711.83
5.4.280.0120.00511.77
5.4.270.0100.00911.71
5.4.260.0130.00611.77
5.4.250.0120.00811.78
5.4.240.0100.00711.71
5.4.230.0120.00611.75
5.4.220.0120.00611.74
5.4.210.0110.00711.68
5.4.200.0130.00511.79
5.4.190.0110.00611.75
5.4.180.0120.00611.77
5.4.170.0110.00511.67
5.4.160.0110.00611.68
5.4.150.0130.00411.66
5.4.140.0110.00611.76
5.4.130.0090.00711.73
5.4.120.0110.00511.72
5.4.110.0090.00811.74
5.4.100.0100.00611.69
5.4.90.0110.00511.72
5.4.80.0110.00611.75
5.4.70.0100.00711.75
5.4.60.0100.00811.72
5.4.50.0090.00711.68
5.4.40.0120.00711.74
5.4.30.0090.00811.73
5.4.20.0120.00611.73
5.4.10.0110.00611.72
5.4.00.0120.00511.75
5.3.290.0130.00611.88
5.3.280.0100.00811.80
5.3.270.0110.00611.72
5.3.260.0100.00811.75
5.3.250.0110.00611.74
5.3.240.0110.00711.60
5.3.230.0110.00711.65
5.3.220.0120.00611.62
5.3.210.0130.00711.61
5.3.200.0090.00811.63
5.3.190.0130.00411.62
5.3.180.0100.00611.75
5.3.170.0110.00611.78
5.3.160.0110.00711.73
5.3.150.0130.00511.71
5.3.140.0110.00711.70
5.3.130.0140.00411.68
5.3.120.0110.00711.72
5.3.110.0120.00611.70
5.3.100.0120.00511.73
5.3.90.0100.00711.74
5.3.80.0110.00611.68
5.3.70.0100.00611.61
5.3.60.0110.00511.79
5.3.50.0110.00711.64
5.3.40.0100.00711.69
5.3.30.0100.00611.77
5.3.20.0120.00511.72
5.3.10.0110.00711.61
5.3.00.0110.00611.58
5.2.170.0150.00512.01
5.2.160.0130.00912.08
5.2.150.0120.00712.17
5.2.140.0140.00611.99
5.2.130.0140.00911.94
5.2.120.0140.00612.01
5.2.110.0120.00912.00
5.2.100.0120.00812.10
5.2.90.0130.00911.95
5.2.80.0130.00811.86
5.2.70.0120.00811.88
5.2.60.0100.01011.84
5.2.50.0130.01111.99
5.2.40.0110.00811.90
5.2.30.0120.00811.94
5.2.20.0120.00811.75
5.2.10.0130.00711.75
5.2.00.0080.01211.67
5.1.60.0090.00911.06
5.1.50.0100.00711.17
5.1.40.0120.00511.18
5.1.30.0090.00711.29
5.1.20.0120.00611.18
5.1.10.0120.00711.11
5.1.00.0110.00510.98
5.0.50.0070.01110.89
5.0.40.0090.00910.84
5.0.30.0090.00710.84
5.0.20.0050.00710.84
5.0.10.0060.00810.84
5.0.00.0100.00410.84
4.4.90.0120.00010.84
4.4.80.0060.00410.84
4.4.70.0030.00710.84
4.4.60.0070.00310.84
4.4.50.0080.00210.84
4.4.40.0060.00410.84
4.4.30.0050.00410.84
4.4.20.0090.00310.84
4.4.10.0070.00410.84
4.4.00.0030.00610.84
4.3.110.0040.00510.84
4.3.100.0070.00110.84
4.3.90.0050.00310.84
4.3.80.0070.00210.84
4.3.70.0070.00410.84
4.3.60.0070.00310.84
4.3.50.0050.00310.84
4.3.40.0050.00310.84
4.3.30.0030.00510.84
4.3.20.0060.00110.84
4.3.10.0080.00110.84
4.3.00.0050.00410.84

preferences:
12.9 ms | 406 KiB | 5 Q