3v4l.org

run code in 300+ PHP versions simultaneously
<?php # Инициализация переменных : $aResult = array(); # результирующий массив # Загрузка страницы : $sResponse = $this->curl( 'user/eggs/activate/content/form.action', array( 'code' => $sCode ) ); # Преобразование ответа в массив : $aResponse = json_decode( $sResponse, true ); # Загрузка страницы : $sResponse = $this->curl( 'user/eggs/activate/content/form.action', array( 'code' => $sCode, 'token' => $aResponse['data']['token'] ) ); # Если зачисления не произошло : if( mb_substr_count( $sResponse, $sCode ) != 2 ) { if( count( $aExplode = explode( '<p>', $sResponse ) ) < 3 ) throw new Exception( 'undefined error' ); $aExplode = explode( '</', $aExplode[2] ); throw new Exception( trim( strip_tags( $aExplode[0] ) ) ); } # Парсинг суммы : if( count( $aExplode = explode( 'на сумму', $sResponse ) ) < 2 ) throw new Exception( 'error parse amount' ); $aExplode = explode( 'руб', $aExplode[1] ); $aResult['dAmount'] = preg_replace( '/[^0-9\.]+/', '', str_replace( ',', '.', trim( $aExplode[0] ) ) ) - 0; # Парсинг примечания : if( count( $aExplode = explode( 'Комментарий к переводу', $sResponse ) ) < 2 ) throw new Exception( 'error parse comment' ); $aExplode = explode( '</p>', $aExplode[1] ); $aResult['sComment'] = trim( strip_tags( $aExplode[0] ) ); # Подтверждение : $aResponse = json_decode( $this->curl( 'user/eggs/activate/content/activate.action', array( 'code' => $sCode ) ), true ); # Проверка подтверждения : if( !isset( $aResponse['code'] ) || !isset( $aResponse['code']['value'] ) || !isset( $aResponse['code']['_name'] ) || $aResponse['code']['value'] != '0' || $aResponse['code']['_name'] != 'NORMAL' ) throw new Exception( 'bad server answer: '.var_export( $aResponse, true ) ); return $aResult; $this->curl( 'settings/options/security.action' ); # Загрузка страницы : $aResponse = json_decode( $this->curl( 'user/person/change/security.action', array( 'type' => 'SMS_CONFIRMATION', 'value' => $bOff ? 'false' : 'true' ) ), true ); # Проверка ответа : if( !isset( $aResponse['code'] ) || !isset( $aResponse['code']['value'] ) || $aResponse['code']['value'] != 7 || !isset( $aResponse['data'] ) || !isset( $aResponse['data']['token'] ) ) throw new Exception( json_encode( $aResponse ) ); # Инициализация переменных : $sToken = $aResponse['data']['token']; # Загрузка страницы : $aResponse = json_decode( $this->curl( 'user/person/change/security.action', array( 'token' => $sToken, 'type' => 'SMS_CONFIRMATION', 'value' => $bOff ? 'false' : 'true' ) ), true ); # Проверка ответа : if( isset( $aResponse['code'] ) && isset( $aResponse['code']['value'] ) && $aResponse['code']['value'] == 0 ) return true; # Проверка ответа : if( !isset( $aResponse['code'] ) || !isset( $aResponse['code']['value'] ) || $aResponse['code']['value'] != 4 || !isset( $aResponse['identifier'] ) || $aResponse['identifier'] <= 0 ) throw new Exception( json_encode( $aResponse ) ); # Инициализация переменных : $iIdentifier = $aResponse['identifier']; # Загрузка страницы : $this->curl( 'user/confirmation/form.action', array( 'identifier' => $iIdentifier, 'token' => $sToken, 'type' => 'SMS_CONFIRMATION', 'value' => $bOff ? 'false' : 'true' ) ); return $iIdentifier;

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.0070.01118.55
8.3.50.0120.00917.95
8.3.40.0090.00618.69
8.3.30.0120.00318.64
8.3.20.0040.00420.34
8.3.10.0040.00423.69
8.3.00.0040.00419.16
8.2.180.0060.00918.41
8.2.170.0120.00322.96
8.2.160.0070.01120.48
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0090.00017.63
8.2.120.0000.00726.35
8.2.110.0080.00322.27
8.2.100.0110.00018.05
8.2.90.0030.00619.34
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0060.00319.44
8.2.30.0050.00220.85
8.2.20.0030.00617.66
8.2.10.0000.00718.14
8.2.00.0040.00418.02
8.1.280.0090.00625.92
8.1.270.0040.00422.03
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0030.00622.57
8.1.230.0040.00817.76
8.1.220.0080.00017.78
8.1.210.0060.00318.77
8.1.200.0040.00717.48
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0060.00319.16
8.1.160.0000.00822.09
8.1.150.0080.00018.95
8.1.140.0000.00819.48
8.1.130.0070.00017.74
8.1.120.0070.00017.37
8.1.110.0000.01117.52
8.1.100.0040.00417.35
8.1.90.0000.00817.47
8.1.80.0070.00017.37
8.1.70.0030.00317.34
8.1.60.0060.00317.60
8.1.50.0060.00317.63
8.1.40.0030.00517.53
8.1.30.0050.00317.79
8.1.20.0040.00417.64
8.1.10.0040.00417.68
8.1.00.0050.00317.62
8.0.300.0000.00818.77
8.0.290.0040.00416.60
8.0.280.0030.00318.34
8.0.270.0000.00717.20
8.0.260.0030.00617.29
8.0.250.0040.00417.05
8.0.240.0030.00317.04
8.0.230.0040.00416.92
8.0.220.0030.00316.99
8.0.210.0050.00316.89
8.0.200.0030.00316.97
8.0.190.0000.00817.06
8.0.180.0080.00016.91
8.0.170.0000.00817.07
8.0.160.0040.00416.89
8.0.150.0000.00816.93
8.0.140.0030.00716.96
8.0.130.0080.00013.39
8.0.120.0030.00616.91
8.0.110.0040.00416.92
8.0.100.0040.00416.93
8.0.90.0040.00416.94
8.0.80.0050.01117.04
8.0.70.0080.00017.02
8.0.60.0030.00616.96
8.0.50.0080.00017.00
8.0.30.0060.01017.22
8.0.20.0120.00717.40
8.0.10.0040.00417.14
8.0.00.0100.00917.01
7.4.330.0050.00016.84
7.4.320.0070.00016.49
7.4.300.0000.00616.55
7.4.290.0080.00016.59
7.4.280.0000.00716.50
7.4.270.0070.00016.60
7.4.260.0070.00016.63
7.4.250.0000.00916.66
7.4.240.0000.00716.64
7.4.230.0000.00716.67
7.4.220.0100.01316.58
7.4.210.0040.01116.70
7.4.200.0030.00316.55
7.4.160.0060.01316.72
7.4.150.0070.01017.40
7.4.140.0070.01217.86
7.4.130.0060.01116.56
7.4.120.0100.00716.74
7.4.110.0150.00916.70
7.4.100.0090.00916.57
7.4.90.0100.01016.75
7.4.80.0100.00719.39
7.4.70.0150.00316.75
7.4.60.0120.00316.67
7.4.50.0160.00016.58
7.4.40.0070.01316.48
7.4.30.0090.00916.70
7.4.00.0120.00614.93
7.3.330.0000.00613.27
7.3.320.0060.00013.19
7.3.310.0030.00316.36
7.3.300.0000.00716.40
7.3.290.0070.01016.40
7.3.280.0090.01016.36
7.3.270.0030.01417.40
7.3.260.0080.00816.40
7.3.250.0080.01016.31
7.3.240.0120.00916.49
7.3.230.0070.01016.39
7.3.210.0030.02216.38
7.3.200.0110.01116.70
7.3.190.0100.00616.39
7.3.180.0100.00616.31
7.3.170.0070.01016.41
7.3.160.0130.00316.40
7.3.120.0040.01514.68
7.3.110.0060.00914.80
7.3.100.0060.00914.73
7.3.90.0030.00614.96
7.3.80.0030.00814.93
7.3.70.0030.00914.89
7.3.60.0000.01414.88
7.3.50.0040.01114.76
7.3.40.0000.01014.93
7.3.30.0030.01014.93
7.3.20.0070.00416.26
7.3.10.0070.01016.59
7.3.00.0000.00916.34
7.2.330.0140.00616.72
7.2.320.0120.01216.57
7.2.310.0120.00616.50
7.2.300.0070.01016.53
7.2.290.0110.00716.46
7.2.240.0090.00915.18
7.2.230.0000.01214.87
7.2.220.0070.00314.92
7.2.210.0030.01415.14
7.2.200.0030.00915.11
7.2.190.0090.00315.00
7.2.180.0030.01314.85
7.2.170.0000.01114.95
7.2.160.0000.01314.87
7.2.150.0090.00616.50
7.2.140.0000.01816.54
7.2.130.0030.00616.63
7.2.120.0040.01116.81
7.2.110.0030.00916.70
7.2.100.0130.00316.78
7.2.90.0200.00316.75
7.2.80.0040.01216.86
7.2.70.0160.00616.86
7.2.60.0020.01516.80
7.2.50.0000.01016.49
7.2.40.0200.00516.88
7.2.30.0030.01016.88
7.2.20.0100.00316.75
7.2.10.0060.01516.84
7.2.00.0060.00817.99
7.1.330.0110.00715.68
7.1.320.0050.00215.63
7.1.310.0030.01315.57
7.1.300.0030.00715.37
7.1.290.0030.00615.64
7.1.280.0060.00615.63
7.1.270.0040.00415.46
7.1.260.0030.01215.79
7.1.250.0030.00715.78
7.1.200.0050.00515.73
7.1.100.0040.00818.14
7.1.70.0040.00417.01
7.1.60.0090.01619.48
7.1.50.0120.00016.59
7.1.00.0030.07722.40
7.0.200.0320.00414.53
7.0.60.0070.09020.06
7.0.50.0070.07718.00
7.0.40.0200.07320.23
7.0.30.0230.03720.18
7.0.20.0100.04720.01
7.0.10.0030.09020.29
7.0.00.0070.06020.08
5.6.280.0070.06020.96
5.6.210.0100.03320.61
5.6.200.0100.08018.20
5.6.190.0100.06720.61
5.6.180.0570.06720.57
5.6.170.0200.05020.47
5.6.160.0070.08020.51
5.6.150.0130.06018.17
5.6.140.0000.04718.18
5.6.130.0170.07318.21
5.6.120.0030.04021.14
5.6.110.0000.04721.00
5.6.100.0030.07721.15
5.6.90.0200.07321.05
5.6.80.0300.06720.48
5.5.350.3530.03020.34
5.5.340.0100.05717.97
5.5.330.0170.08020.40
5.5.320.0500.07320.21
5.5.310.0200.05720.41
5.5.300.0130.07717.92
5.5.290.0000.04718.01
5.5.280.0000.04320.80
5.5.270.0100.07720.88
5.5.260.0100.07320.68
5.5.250.0100.05320.63
5.5.240.0200.05720.30

preferences:
52.18 ms | 400 KiB | 5 Q