3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WithPublic { public $property; function __construct( $p ) { $this->property = $p; } function getProperty() { print $this->property; } } class WithPrivate { private $property; function __construct( $p ) { $this->property = $p; } function getProperty() { print $this->property; } } $pub = new WithPublic( 'value' ); $pub_s = serialize( $pub ); $priv = new WithPrivate( 'value' ); $priv_s = serialize( $priv ); echo "Class with public property unserialized to class with private property\n"; $mut_pub_to_priv = unserialize( str_replace( '10:"WithPublic"', '11:"WithPrivate"', $pub_s ) ); var_dump( $mut_pub_to_priv ); echo "Property should be 'value': "; var_export( $mut_pub_to_priv->getProperty() ); echo "\n"; echo "\nClass with private property unserialized to class with public property\n"; $mut_priv_to_pub = unserialize( str_replace( '11:"WithPrivate"', '10:"WithPublic"', $priv_s ) ); var_dump( $mut_priv_to_pub ); echo "Property should be 'value': "; var_export( $mut_priv_to_pub->getProperty() ); echo "\n";

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.0040.00417.66
8.3.140.0030.00720.69
8.3.130.0080.00316.72
8.3.120.0080.00021.06
8.3.110.0090.00020.94
8.3.100.0100.01024.06
8.3.90.0000.00818.68
8.3.80.0060.00318.68
8.3.70.0110.00416.86
8.3.60.0150.00616.38
8.3.50.0120.01022.86
8.3.40.0100.01018.93
8.3.30.0060.00918.67
8.3.20.0040.00421.88
8.3.10.0050.00321.74
8.3.00.0060.00320.73
8.2.260.0090.00917.26
8.2.250.0040.00416.73
8.2.240.0030.00617.34
8.2.230.0080.00822.58
8.2.220.0060.01237.54
8.2.210.0060.00926.77
8.2.200.0090.00018.31
8.2.190.0070.00716.58
8.2.180.0120.00918.41
8.2.170.0120.00322.96
8.2.160.0070.00720.35
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.01019.30
8.2.110.0070.00321.09
8.2.100.0100.00017.91
8.2.90.0040.00418.34
8.2.80.0030.00518.96
8.2.70.0050.00317.80
8.2.60.0050.00318.03
8.2.50.0040.00418.10
8.2.40.0040.00421.14
8.2.30.0040.00419.23
8.2.20.0000.00718.04
8.2.10.0040.00418.00
8.2.00.0040.00417.68
8.1.300.0060.00619.37
8.1.290.0060.00318.88
8.1.280.0100.00725.92
8.1.270.0040.00420.15
8.1.260.0080.00028.09
8.1.250.0000.00828.09
8.1.240.0090.00022.20
8.1.230.0060.00620.97
8.1.220.0000.00717.74
8.1.210.0090.00019.96
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0000.00818.46
8.1.160.0040.00418.84
8.1.150.0040.00418.78
8.1.140.0030.00519.50
8.1.130.0070.00019.01
8.1.120.0000.00817.29
8.1.110.0040.00417.40
8.1.100.0000.00717.32
8.1.90.0000.00817.47
8.1.80.0000.00717.29
8.1.70.0000.00817.41
8.1.60.0050.00317.60
8.1.50.0000.00817.41
8.1.40.0040.00417.48
8.1.30.0000.00917.66
8.1.20.0070.00017.52
8.1.10.0040.00417.61
8.1.00.0000.00817.48
8.0.300.0000.00720.09
8.0.290.0070.00016.75
8.0.280.0040.00418.32
8.0.270.0000.00717.26
8.0.260.0000.00717.18
8.0.250.0030.00316.91
8.0.240.0030.00316.93
8.0.230.0000.00717.00
8.0.220.0000.00816.79
8.0.210.0030.00316.93
8.0.200.0080.00316.84
8.0.190.0040.00416.87
8.0.180.0040.00416.80
8.0.170.0040.00416.95
8.0.160.0030.00616.79
8.0.150.0000.00916.77
8.0.140.0000.00716.86
8.0.130.0030.00313.35
8.0.120.0040.00416.88
8.0.110.0000.00716.89
8.0.100.0000.00816.74
8.0.90.0000.00716.94
8.0.80.0040.01116.86
8.0.70.0000.00716.85
8.0.60.0030.00516.90
8.0.50.0000.00716.78
8.0.30.0090.00817.25
8.0.20.0120.00917.40
8.0.10.0000.00717.06
8.0.00.0120.00616.58
7.4.330.0000.00515.55
7.4.320.0030.00316.54
7.4.300.0030.00316.66
7.4.290.0070.00016.64
7.4.280.0080.00316.59
7.4.270.0070.00016.43
7.4.260.0030.00616.56
7.4.250.0040.00416.54
7.4.240.0070.00016.40
7.4.230.0080.00016.41
7.4.220.0140.01016.46
7.4.210.0060.00916.69
7.4.200.0030.00316.55
7.4.160.0060.01116.37
7.4.150.0080.01117.40
7.4.140.0070.01017.86
7.4.130.0130.00616.52
7.4.120.0100.00816.53
7.4.110.0050.01916.62
7.4.100.0130.01316.56
7.4.90.0090.00916.36
7.4.80.0130.00419.39
7.4.70.0140.01116.50
7.4.60.0080.00816.55
7.4.50.0060.00916.55
7.4.40.0070.01616.60
7.4.30.0060.01116.46
7.4.10.0130.00716.60
7.4.00.0080.01015.44
7.3.330.0050.00213.09
7.3.320.0040.00413.26
7.3.310.0070.00016.26
7.3.300.0040.00416.34
7.3.290.0100.00516.24
7.3.280.0100.00816.22
7.3.270.0140.00317.40
7.3.260.0100.00716.42
7.3.250.0100.01116.41
7.3.240.0140.00516.32
7.3.230.0090.00916.42
7.3.210.0080.00816.48
7.3.200.0100.01319.39
7.3.190.0030.01616.34
7.3.180.0070.01416.30
7.3.170.0110.01016.40
7.3.160.0090.01316.40
7.3.130.0150.00416.07
7.3.120.0090.00815.68
7.3.110.0020.01115.52
7.3.100.0090.00715.59
7.3.90.0050.00815.31
7.3.80.0100.00715.66
7.3.70.0030.01015.42
7.3.60.0060.00615.56
7.3.50.0070.00715.48
7.3.40.0080.00715.35
7.3.30.0080.00615.56
7.3.20.0020.00917.35
7.3.10.0160.00017.38
7.3.00.0020.00817.30
7.2.330.0110.00716.82
7.2.320.0160.00616.66
7.2.310.0040.01716.77
7.2.300.0100.01416.61
7.2.290.0160.00016.61
7.2.260.0070.01316.78
7.2.250.0090.01015.86
7.2.240.0080.00916.05
7.2.230.0060.00815.81
7.2.220.0090.00515.80
7.2.210.0040.00815.90
7.2.200.0050.00915.78
7.2.190.0070.00815.78
7.2.180.0040.01215.79
7.2.170.0050.00815.84
7.2.160.0000.01316.64
7.2.150.0090.00618.41
7.2.140.0060.00918.55
7.2.130.0070.00718.19
7.2.120.0110.00418.57
7.2.110.0030.01018.35
7.2.100.0060.00918.60
7.2.90.0070.01418.26
7.2.80.0070.01018.49
7.2.70.0040.00718.41
7.2.60.0040.01117.72
7.2.50.0080.00418.45
7.2.40.0080.00818.37
7.2.30.0060.00618.46
7.2.20.0070.00718.52
7.2.10.0000.01018.23
7.2.00.0080.01018.76
7.1.330.0110.00416.55
7.1.320.0050.00816.53
7.1.310.0090.00316.65
7.1.300.0070.00816.38
7.1.290.0080.00416.53
7.1.280.0050.00816.55
7.1.270.0050.00816.57
7.1.260.0070.00716.60
7.1.250.0110.00417.12
7.1.240.0030.00917.22
7.1.230.0110.00417.37
7.1.220.0060.00617.36
7.1.210.0040.01217.13
7.1.200.0070.00916.60
7.1.190.0090.00617.33
7.1.180.0060.00317.14
7.1.170.0060.01317.14
7.1.160.0100.00017.25
7.1.150.0000.01017.14
7.1.140.0050.00517.27
7.1.130.0030.01017.32
7.1.120.0070.00717.18
7.1.110.0060.00917.22
7.1.100.0040.00917.32
7.1.90.0060.00317.10
7.1.80.0070.01017.31
7.1.70.0050.00517.16
7.1.60.0090.00517.22
7.1.50.0090.00816.97
7.1.40.0070.00317.28
7.1.30.0000.01617.39
7.1.20.0120.00417.29
7.1.10.0150.04719.42
7.1.00.0150.03319.03
7.0.330.0060.00617.06
7.0.320.0080.00316.95
7.0.310.0030.01616.78
7.0.300.0120.00617.11
7.0.290.0070.00716.93
7.0.280.0070.00716.84
7.0.270.0040.01116.86
7.0.260.0080.00316.89
7.0.250.0090.00617.00
7.0.240.0030.00617.03
7.0.230.0040.00816.99
7.0.220.0090.00016.95
7.0.210.0090.00617.08
7.0.200.0080.00816.79
7.0.190.0070.00717.21
7.0.180.0000.01116.89
7.0.170.0050.00816.98
7.0.160.0000.01517.06
7.0.150.0120.03718.60
7.0.140.0180.02818.60
7.0.130.0150.03218.49
7.0.120.0170.02818.47
7.0.110.0220.02518.49
7.0.100.0080.03618.47
7.0.90.0130.03318.59
7.0.80.0170.03418.47
7.0.70.0100.03318.47
7.0.60.0130.03518.53
7.0.50.0110.03518.62
7.0.40.0100.03018.40
7.0.30.0050.03518.41
7.0.20.0060.03218.39
7.0.10.0050.03518.37
7.0.00.0120.03318.39
5.6.400.0040.00815.93
5.6.390.0110.00316.18
5.6.380.0050.00515.60
5.6.370.0060.00616.02
5.6.360.0070.00715.75
5.6.350.0110.00716.01
5.6.340.0100.00716.32
5.6.330.0030.01415.95
5.6.320.0090.00615.86
5.6.310.0100.00716.10
5.6.300.0060.01016.02
5.6.290.0040.01515.97
5.6.280.0060.00916.02
5.6.270.0080.00316.29
5.6.260.0070.01315.97
5.6.250.0120.00915.96
5.6.240.0040.01116.00
5.6.230.0090.00315.88
5.6.220.0040.00815.80
5.6.210.0040.01115.65
5.6.200.0090.00916.00
5.6.190.0130.00015.87
5.6.180.0060.00916.00
5.6.170.0070.00316.02
5.6.160.0040.01416.04
5.6.150.0000.01115.93
5.6.140.0030.00916.11
5.6.130.0100.00615.90
5.6.120.0090.00616.05
5.6.110.0030.01515.87
5.6.100.0040.01215.81
5.6.90.0030.01015.78
5.6.80.0090.00315.82
5.6.70.0060.00615.81
5.6.60.0080.00315.82
5.6.50.0030.00615.79
5.6.40.0110.00015.61
5.6.30.0070.01115.71
5.6.20.0130.00315.78
5.6.10.0040.01116.00
5.6.00.0070.00315.87

preferences:
62.29 ms | 403 KiB | 5 Q