3v4l.org

run code in 300+ PHP versions simultaneously
<?php function find_date( $string ) { //Define month name: $month_names = array( "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" ); $month_number=$month=$matches_year=$year=$matches_month_number=$matches_month_word=$matches_day_number=""; //Match dates: 01/01/2012 or 30-12-11 or 1 2 1985 preg_match( '/([0-9]?[0-9])[\.\-\/ ]?([0-1]?[0-9])[\.\-\/ ]?([0-9]{2,4})/', $string, $matches ); if ( $matches ) { if ( $matches[1] ) $day = $matches[1]; if ( $matches[2] ) $month = $matches[2]; if ( $matches[3] ) $year = $matches[3]; } //Match month name: preg_match( '/(' . implode( '|', $month_names ) . ')/i', $string, $matches_month_word ); echo ($matches_month_word[1]);exit; if ( $matches_month_word ) { if ( $matches_month_word[1] ) $month = array_search( strtolower( $matches_month_word[1] ), $month_names ) + 1; } //Match 5th 1st day: preg_match( '/([0-9]?[0-9])(st|nd|th)/', $string, $matches_day ); if ( $matches_day ) { if ( $matches_day[1] ) $day = $matches_day[1]; } //Match Year if not already setted: if ( empty( $year ) ) { preg_match( '/[0-9]{2}/', $string, $matches_year ); if ( $matches_year[0] ) $year = $matches_year[0]; } if ( ! empty ( $day ) && ! empty ( $month ) && empty( $year ) ) { preg_match( '/[0-9]{2}/', $string, $matches_year ); if ( $matches_year[0] ) $year = $matches_year[0]; } $day = '01'; //Leading 0 if ( 1 == strlen( $day ) ) $day = '0' . $day; //Leading 0 if ( 1 == strlen( $month ) ) $month = '0' . $month; //Check year: if ( 2 == strlen( $year ) && $year > 20 ) $year = '19' . $year; else if ( 2 == strlen( $year ) && $year < 20 ) $year = '20' . $year; $date = array( 'year' => $year, 'month' => $month, 'day' => $day ); //Return false if nothing found: if ( empty( $year ) && empty( $month ) && empty( $day ) ) return false; else return date('Y-m-d',strtotime($date['year'].'-'.$date['month'].'-01')); } echo find_date('Fund Factsheet Syariah - Jan 1914');

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.0090.00918.68
8.3.50.0080.01022.06
8.3.40.0110.01119.04
8.3.30.0090.00619.04
8.3.20.0080.00019.10
8.3.10.0090.00023.53
8.3.00.0040.00419.12
8.2.180.0150.00618.66
8.2.170.0160.00019.00
8.2.160.0120.00322.96
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0200.00019.95
8.2.110.0100.00019.28
8.2.100.0080.00418.03
8.2.90.0050.00320.42
8.2.80.0060.00318.03
8.2.70.0050.00317.93
8.2.60.0060.00318.16
8.2.50.0000.00818.10
8.2.40.0040.00419.33
8.2.30.0000.00719.61
8.2.20.0070.00018.07
8.2.10.0000.00918.19
8.2.00.0080.00018.23
8.1.280.0070.01025.92
8.1.270.0040.00420.34
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00722.13
8.1.230.0040.00721.08
8.1.220.0040.00417.77
8.1.210.0060.00319.30
8.1.200.0030.00717.47
8.1.190.0040.00417.35
8.1.180.0000.01118.10
8.1.170.0050.00318.91
8.1.160.0000.00721.99
8.1.150.0040.00418.87
8.1.140.0000.00817.64
8.1.130.0070.00017.94
8.1.120.0000.00817.67
8.1.110.0000.00717.53
8.1.100.0050.00317.52
8.1.90.0070.00017.68
8.1.80.0040.00317.60
8.1.70.0000.00717.63
8.1.60.0030.00617.80
8.1.50.0030.00517.75
8.1.40.0040.00417.69
8.1.30.0030.00517.77
8.1.20.0060.00317.71
8.1.10.0000.00817.77
8.1.00.0070.00017.70
8.0.300.0000.00720.01
8.0.290.0040.00417.00
8.0.280.0020.00718.39
8.0.270.0040.00417.23
8.0.260.0070.00017.32
8.0.250.0030.00317.21
8.0.240.0030.00517.10
8.0.230.0030.00617.07
8.0.220.0000.00717.02
8.0.210.0000.00717.08
8.0.200.0040.00417.21
8.0.190.0070.00017.11
8.0.180.0040.00417.17
8.0.170.0050.00317.20
8.0.160.0040.00417.18
8.0.150.0080.00016.96
8.0.140.0000.00716.99
8.0.130.0000.00613.59
8.0.120.0000.00817.17
8.0.110.0080.00017.16
8.0.100.0040.00417.20
8.0.90.0040.00417.10
8.0.80.0070.01017.20
8.0.70.0050.00316.99
8.0.60.0040.00417.03
8.0.50.0040.00417.06
8.0.30.0030.01317.47
8.0.20.0130.00817.46
8.0.10.0080.00017.25
8.0.00.0110.00617.24
7.4.330.0050.00015.04
7.4.320.0030.00316.84
7.4.300.0060.00016.77
7.4.290.0030.00516.86
7.4.280.0030.00616.71
7.4.270.0070.00016.69
7.4.260.0000.00716.74
7.4.250.0040.00416.72
7.4.240.0020.00616.83
7.4.230.0040.00416.64
7.4.220.0100.01416.79
7.4.210.0080.01016.81
7.4.200.0000.00816.95
7.4.160.0100.00716.88
7.4.150.0080.01117.40
7.4.140.0090.01117.86
7.4.130.0140.00816.80
7.4.120.0070.01016.88
7.4.110.0090.00916.71
7.4.100.0070.01616.81
7.4.90.0120.00616.75
7.4.80.0140.00519.39
7.4.70.0100.01316.76
7.4.60.0090.00616.75
7.4.50.0040.00416.57
7.4.40.0120.00916.56
7.4.30.0080.00916.79
7.4.00.0070.01015.12
7.3.330.0000.00613.38
7.3.320.0030.00313.55
7.3.310.0030.00516.58
7.3.300.0000.00716.38
7.3.290.0040.00416.45
7.3.280.0090.01016.44
7.3.270.0140.00317.40
7.3.260.0100.00716.79
7.3.250.0100.00716.64
7.3.240.0040.01416.87
7.3.230.0030.01416.47
7.3.210.0070.01116.63
7.3.200.0100.00719.39
7.3.190.0130.00916.61
7.3.180.0030.01316.58
7.3.170.0140.00716.49
7.3.160.0060.01016.70
7.3.120.0030.01614.98
7.3.110.0070.01015.07
7.3.100.0120.00315.02
7.3.90.0030.01014.86
7.3.80.0080.00414.92
7.3.70.0070.00714.84
7.3.60.0120.00015.07
7.3.50.0000.01215.08
7.3.40.0030.00914.74
7.3.30.0040.00415.15
7.3.20.0090.00316.77
7.3.10.0030.01016.55
7.3.00.0030.00616.79
7.2.330.0170.00716.89
7.2.320.0060.01916.85
7.2.310.0120.00616.95
7.2.300.0070.01316.62
7.2.290.0100.01016.75
7.2.250.0080.01115.43
7.2.240.0060.01315.20
7.2.230.0060.00915.27
7.2.220.0070.00415.20
7.2.210.0060.00315.22
7.2.200.0030.00915.53
7.2.190.0100.00315.14
7.2.180.0030.00615.39
7.2.170.0030.01015.07
7.2.60.0030.00817.04
7.2.00.0030.00919.49
7.1.330.0070.01015.99
7.1.320.0030.01015.57
7.1.310.0090.00615.97
7.1.300.0100.00316.04
7.1.290.0070.00415.83
7.1.280.0060.00815.80
7.1.270.0030.01015.64
7.1.260.0040.01215.78
7.1.200.0000.01216.00
7.1.100.0040.01118.28
7.1.70.0060.00317.44
7.1.60.0140.01119.48
7.1.50.0060.01917.31
7.1.00.0030.07722.48
7.0.200.0030.00516.97
7.0.60.0070.04019.95
7.0.50.0030.08718.00
7.0.40.0030.09720.23
7.0.30.0170.07020.09
7.0.20.0330.07720.40
7.0.10.0100.08720.10
7.0.00.0030.06320.20
5.6.280.0030.07321.05
5.6.210.0030.08320.73
5.6.200.0030.04718.16
5.6.190.0030.04720.67
5.6.180.0170.04720.61
5.6.170.0270.03320.54
5.6.160.0100.04720.47
5.6.150.0070.06718.15
5.6.140.0100.03318.15
5.6.130.0000.04318.14
5.6.120.0030.05720.96
5.6.110.0030.05721.04
5.6.100.0130.07721.16
5.6.90.0070.04720.90
5.6.80.0130.04320.42
5.5.350.0070.03020.46
5.5.340.0000.05017.99
5.5.330.0030.05320.43
5.5.320.0030.07720.46
5.5.310.0330.07020.30
5.5.300.0070.06317.98
5.5.290.0070.08017.93
5.5.280.0070.04320.98
5.5.270.0130.07320.98
5.5.260.0030.07720.82
5.5.250.0070.04720.71
5.5.240.0100.03320.25
5.4.450.0630.03719.18
5.4.440.0670.06019.58
5.4.430.0130.05319.31
5.4.420.0030.06019.39
5.4.410.0200.04019.46
5.4.400.0070.05719.10
5.4.390.0170.04719.06
5.4.380.0100.05719.25
5.4.370.0130.05019.20
5.4.360.0070.05319.11
5.4.350.0030.07319.09
5.4.340.0100.05319.11
5.4.320.0070.05719.07
5.4.310.0130.04719.05
5.4.300.0100.05019.03
5.4.290.0100.05019.04
5.4.280.0100.05019.05
5.4.270.0130.04719.24
5.4.260.0130.05019.05
5.4.250.0070.05719.08
5.4.240.0170.04719.05
5.4.230.0100.05019.23
5.4.220.0100.05319.23
5.4.210.0170.05018.95
5.4.200.0030.05716.94
5.4.190.0100.05319.00
5.4.180.0100.05319.07
5.4.170.0100.05719.04
5.4.160.0130.04719.02
5.4.150.0130.05019.04
5.4.140.0130.04716.48
5.4.130.0100.05016.22
5.4.120.0070.05316.38
5.4.110.0130.05716.23
5.4.100.0030.06016.25
5.4.90.0130.04716.56
5.4.80.0200.03716.38
5.4.70.0070.05016.26
5.4.60.0030.05716.59
5.4.50.0130.04316.54
5.4.40.0030.06316.31
5.4.30.0130.04316.39
5.4.20.0130.06016.53
5.4.10.0100.04716.35
5.4.00.0100.05015.67
5.3.290.0130.04714.71
5.3.280.0130.05014.80
5.3.270.0070.05314.85
5.3.260.0100.05314.85
5.3.250.0130.04714.59
5.3.240.0070.05314.59
5.3.230.0170.04714.54
5.3.220.0030.05714.66
5.3.210.0030.06014.50
5.3.200.0030.05714.55
5.3.190.0130.06314.47
5.3.180.0100.05014.71
5.3.170.0170.04314.77
5.3.160.0130.05014.81
5.3.150.0100.05314.68
5.3.140.0100.05714.76
5.3.130.0130.05014.74
5.3.120.0070.06014.68
5.3.110.0030.06014.54
5.3.100.0130.05314.15
5.3.90.0170.05014.03
5.3.80.0030.05714.06
5.3.70.0200.04713.99
5.3.60.0130.04714.24
5.3.50.0100.07014.01
5.3.40.0100.05014.02
5.3.30.0100.05013.90
5.3.20.0170.04013.69
5.3.10.0070.05313.71
5.3.00.0030.05713.73
5.2.170.0170.03311.25
5.2.160.0100.03711.39
5.2.150.0030.04311.36
5.2.140.0170.04311.20
5.2.130.0030.04311.11
5.2.120.0070.04311.05
5.2.110.0130.03311.09
5.2.100.0000.04711.10
5.2.90.0070.04011.19
5.2.80.0070.04311.19
5.2.70.0100.04011.16
5.2.60.0070.04011.06
5.2.50.0000.04711.07
5.2.40.0130.03311.06
5.2.30.0030.04310.92
5.2.20.0000.04711.17
5.2.10.0100.03710.87
5.2.00.0070.04010.71
5.1.60.0100.03010.13
5.1.50.0030.0379.95
5.1.40.0030.03710.06
5.1.30.0000.04310.34
5.1.20.0100.03310.45
5.1.10.0070.03710.14
5.1.00.0100.03010.09
5.0.50.0070.0278.64
5.0.40.0030.0278.34
5.0.30.0030.0438.25
5.0.20.0000.0338.38
5.0.10.0000.0338.35
5.0.00.0070.0408.23
4.4.90.0070.0205.99
4.4.80.0130.0105.88
4.4.70.0100.0175.87
4.4.60.0100.0175.99
4.4.50.0130.0175.95
4.4.40.0030.0375.79
4.4.30.0030.0235.87
4.4.20.0000.0275.88
4.4.10.0030.0276.04
4.4.00.0070.0335.95
4.3.110.0000.0235.83
4.3.100.0030.0205.72
4.3.90.0000.0235.70
4.3.80.0070.0305.83
4.3.70.0070.0175.70
4.3.60.0000.0235.72
4.3.50.0030.0275.82
4.3.40.0070.0305.77
4.3.30.0000.0234.55
4.3.20.0000.0234.62
4.3.10.0030.0204.48
4.3.00.0270.01316.00

preferences:
60.51 ms | 401 KiB | 5 Q