3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isAnagram( $phrase1, $phrase2 ) { $phrase1 = strtolower(preg_replace("/[^a-zA-Z]/", "", $phrase1)); $phrase2 = strtolower(preg_replace("/[^a-zA-Z]/", "", $phrase2)); // todo: fix splitting $a1 = str_split($phrase1); $a2 = str_split($phrase2); sort($a1); sort($a2); $phrase1 = join("",$a1); $phrase2 = join("",$a2); return ( $phrase1 === $phrase2 ); } echo "Test1 = " . (isAnagram( "", "" ) ? "Is anagram" : "Is not") . "\n"; echo "Test2 = " . (isAnagram( "Dormitory", "Dirty room" ) ? "Is anagram" : "Is not") . "\n"; echo "Test3 = " . (isAnagram( "A decimal point", "I'm a dot in place" ) ? "Is anagram" : "Is not") . "\n"; echo "Test4 = " . (isAnagram( "A decimal point no?", "I'm a dot in place" ) ? "Is anagram" : "Is not") . "\n"; echo "Test5 = " . (isAnagram( "A decimal point", "I'm a dot in place yes?" ) ? "Is anagram" : "Is not") . "\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.3.60.0160.00618.55
8.3.50.0140.00922.86
8.3.40.0120.00319.02
8.3.30.0120.00319.04
8.3.20.0040.00420.16
8.3.10.0080.00023.66
8.3.00.0030.00619.38
8.2.180.0110.00717.13
8.2.170.0110.00422.96
8.2.160.0060.00920.18
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0080.00020.96
8.2.110.0040.00720.38
8.2.100.0070.00418.09
8.2.90.0080.00019.22
8.2.80.0030.00617.97
8.2.70.0000.00917.74
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0030.00618.09
8.2.30.0030.00618.19
8.2.20.0070.00017.94
8.2.10.0040.00418.13
8.2.00.0040.00417.89
8.1.280.0140.00425.92
8.1.270.0080.00023.84
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.27
8.1.230.0080.00319.18
8.1.220.0080.00017.91
8.1.210.0080.00018.77
8.1.200.0040.00417.38
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0080.00018.94
8.1.160.0030.00622.04
8.1.150.0040.00418.96
8.1.140.0040.00417.64
8.1.130.0030.00317.89
8.1.120.0030.00517.54
8.1.110.0050.00317.53
8.1.100.0040.00417.71
8.1.90.0000.00717.64
8.1.80.0040.00417.71
8.1.70.0030.00317.52
8.1.60.0070.00717.66
8.1.50.0080.00017.71
8.1.40.0000.00717.73
8.1.30.0000.00817.80
8.1.20.0050.00317.75
8.1.10.0030.00617.72
8.1.00.0000.00717.67
8.0.300.0040.00418.77
8.0.290.0060.00317.00
8.0.280.0000.00718.41
8.0.270.0030.00317.32
8.0.260.0030.00317.21
8.0.250.0000.00817.19
8.0.240.0000.00817.20
8.0.230.0030.00317.16
8.0.220.0030.00317.18
8.0.210.0070.00017.14
8.0.200.0030.00317.18
8.0.190.0000.00817.09
8.0.180.0000.00717.05
8.0.170.0050.00217.12
8.0.160.0040.00417.06
8.0.150.0070.00016.91
8.0.140.0000.00817.00
8.0.130.0030.00313.60
8.0.120.0050.00317.05
8.0.110.0020.00517.00
8.0.100.0070.00017.03
8.0.90.0060.00317.03
8.0.80.0090.01217.02
8.0.70.0000.00716.98
8.0.60.0080.00016.98
8.0.50.0070.00017.03
8.0.30.0090.01017.18
8.0.20.0110.00917.40
8.0.10.0000.00917.04
8.0.00.0150.00616.97
7.4.330.0080.00015.00
7.4.320.0060.00016.85
7.4.300.0030.00316.75
7.4.290.0070.00016.80
7.4.280.0040.00416.77
7.4.270.0070.00316.77
7.4.260.0100.00016.81
7.4.250.0050.00316.64
7.4.240.0000.00916.74
7.4.230.0040.00416.83
7.4.220.0100.01316.88
7.4.210.0100.00616.81
7.4.200.0040.00316.83
7.4.160.0110.00716.53
7.4.150.0110.00717.40
7.4.140.0120.00917.86
7.4.130.0090.01116.68
7.4.120.0120.00616.83
7.4.110.0090.00916.67
7.4.100.0140.00316.77
7.4.90.0070.01016.71
7.4.80.0190.00419.39
7.4.70.0120.00416.82
7.4.60.0060.01016.73
7.4.50.0000.00516.52
7.4.40.0070.01516.78
7.4.30.0080.00816.88
7.4.00.0070.01115.27
7.3.330.0000.00613.46
7.3.320.0000.00513.35
7.3.310.0000.00716.54
7.3.300.0000.00716.46
7.3.290.0060.00916.49
7.3.280.0090.00816.46
7.3.270.0070.01017.40
7.3.260.0110.00916.79
7.3.250.0060.01416.73
7.3.240.0130.00316.73
7.3.230.0140.00416.44
7.3.210.0110.01416.54
7.3.200.0130.00316.80
7.3.190.0150.00416.53
7.3.180.0120.00816.79
7.3.170.0130.00316.55
7.3.160.0080.01116.73
7.3.120.0110.00714.75
7.3.110.0100.00714.77
7.3.100.0070.01015.14
7.3.90.0090.00314.98
7.3.80.0100.00714.86
7.3.70.0000.01414.93
7.3.60.0060.00615.17
7.3.50.0060.00614.86
7.3.40.0100.00715.06
7.3.30.0060.00314.89
7.3.20.0070.00716.79
7.3.10.0090.00316.81
7.3.00.0110.00416.76
7.2.330.0110.00716.83
7.2.320.0100.00716.86
7.2.310.0130.00316.94
7.2.300.0090.00916.73
7.2.290.0110.01116.72
7.2.250.0030.01715.30
7.2.240.0130.00715.25
7.2.230.0070.01014.95
7.2.220.0030.00915.02
7.2.210.0000.01015.39
7.2.200.0100.00315.26
7.2.190.0030.01415.26
7.2.180.0090.00615.25
7.2.170.0070.01015.26
7.2.130.0060.00917.00
7.2.120.0090.00916.83
7.2.110.0120.00616.94
7.2.100.0100.00917.01
7.2.90.0100.00717.09
7.2.80.0120.00816.93
7.2.70.0120.00916.90
7.2.60.0100.01016.99
7.2.50.0170.00716.92
7.2.40.0130.00416.95
7.2.30.0080.01016.93
7.2.20.0060.01016.91
7.2.10.0190.01016.80
7.2.00.0100.00917.72
7.1.330.0080.00815.91
7.1.320.0060.00615.94
7.1.310.0060.00615.85
7.1.300.0070.00415.82
7.1.290.0030.01315.62
7.1.280.0040.00815.79
7.1.270.0040.00715.90
7.1.260.0030.01216.02
7.1.250.0070.00815.63
7.1.230.0060.01115.80
7.1.220.0390.00716.04
7.1.210.0210.01116.02
7.1.200.0160.00616.01
7.1.190.0200.00016.01
7.1.180.0150.00315.89
7.1.170.0150.00015.78
7.1.160.0090.00416.00
7.1.150.0070.01016.07
7.1.140.0320.00315.77
7.1.130.0210.01515.99
7.1.120.0110.00815.78
7.1.110.0090.00316.11
7.1.100.0090.00417.26
7.1.90.0220.00015.97
7.1.80.0090.00315.75
7.1.70.0120.00216.77
7.1.60.0120.00717.77
7.1.50.0090.01316.78
7.1.40.0120.00816.00
7.1.30.0110.00816.25
7.1.20.0100.01016.10
7.1.10.0160.00016.07
7.1.00.0070.04019.13
7.0.310.0050.01115.67
7.0.300.0080.00415.39
7.0.290.0120.00015.49
7.0.280.0080.00315.28
7.0.270.0110.00615.61
7.0.260.0120.00415.49
7.0.250.0120.00315.23
7.0.240.0130.00315.48
7.0.230.0110.00715.61
7.0.220.0180.01115.32
7.0.210.0070.01015.38
7.0.200.0080.00316.16
7.0.190.0150.00015.63
7.0.180.0040.01215.56
7.0.170.0130.00415.63
7.0.160.0080.00815.41
7.0.150.0090.00615.61
7.0.140.0070.03918.76
7.0.130.0100.00315.44
7.0.120.0130.00615.48
7.0.110.0080.00815.53
7.0.100.0100.02817.81
7.0.90.0080.03717.68
7.0.80.0250.03017.89
7.0.70.0070.03917.75
7.0.60.0110.04117.64
7.0.50.0070.03417.97
7.0.40.0090.04316.90
7.0.30.0090.04016.96
7.0.20.0060.02516.66
7.0.10.0080.04116.89
7.0.00.0160.03716.79
5.6.380.0210.00014.71
5.6.370.0170.00014.25
5.6.360.0130.00314.62
5.6.350.0140.00414.26
5.6.340.0070.00714.46
5.6.330.0230.00014.38
5.6.320.0060.01014.37
5.6.310.0120.00414.48
5.6.300.0120.00414.32
5.6.290.0100.00514.03
5.6.280.0060.04117.98
5.6.270.0120.00414.15
5.6.260.0060.01214.77
5.6.250.0050.02917.50
5.6.240.0110.03917.51
5.6.230.0070.02617.67
5.6.220.0160.02317.47
5.6.210.0120.02217.38
5.6.200.0040.03317.69
5.6.190.0090.02417.74
5.6.180.0110.04517.68
5.6.170.0070.02717.77
5.6.160.0120.04017.76
5.6.150.0060.03817.74
5.6.140.0100.04117.68
5.6.130.0110.03517.66
5.6.120.0110.02217.88
5.6.110.0100.03417.69
5.6.100.0060.03517.82
5.6.90.0060.03917.85
5.6.80.0040.02317.39
5.6.70.0090.03117.46
5.6.60.0090.02717.22
5.6.50.0070.04417.40
5.6.40.0050.03617.26
5.6.30.0070.02717.38
5.6.20.0050.03817.54
5.6.10.0080.02317.35
5.6.00.0070.02217.39
5.5.380.0080.02516.59
5.5.370.0050.02516.64
5.5.360.0110.04016.59
5.5.350.0100.03316.63
5.5.340.0050.03316.76
5.5.330.0070.04016.86
5.5.320.0110.03316.86
5.5.310.0100.02016.86
5.5.300.0060.04216.86
5.5.290.0050.03616.86
5.5.280.0130.03216.77
5.5.270.0080.02216.77
5.5.260.0070.02516.85
5.5.250.0060.03716.74
5.5.240.0030.02516.47
5.5.230.0090.03516.47
5.5.220.0060.03816.52
5.5.210.0150.03116.46
5.5.200.0050.04716.46
5.5.190.0080.04216.44
5.5.180.0040.02716.47
5.5.170.0110.00314.34
5.5.160.0110.02816.45
5.5.150.0080.02516.51
5.5.140.0070.02016.44
5.5.130.0070.02016.48
5.5.120.0090.04316.51
5.5.110.0070.02016.52
5.5.100.0110.02316.44
5.5.90.0130.03516.38
5.5.80.0080.04516.44
5.5.70.0100.01816.40
5.5.60.0130.02616.41
5.5.50.0110.01716.42
5.5.40.0070.02516.45
5.5.30.0120.03716.36
5.5.20.0090.03016.47
5.5.10.0090.01816.44
5.5.00.0050.02716.45
5.4.450.0070.03415.98
5.4.440.0070.04115.98
5.4.430.0100.04115.98
5.4.420.0070.02116.12
5.4.410.0120.03316.06
5.4.400.0060.03115.96
5.4.390.0070.02215.99
5.4.380.0030.02515.98
5.4.370.0090.03615.83
5.4.360.0060.04215.83
5.4.350.0080.03315.94
5.4.340.0030.02615.87
5.4.330.0080.00612.79
5.4.320.0050.02315.96
5.4.310.0050.03215.82
5.4.300.0100.01715.83
5.4.290.0100.02515.85
5.4.280.0080.02015.92
5.4.270.0060.02615.81
5.4.260.0050.02616.00
5.4.250.0050.03715.86
5.4.240.0080.02515.84
5.4.230.0050.04515.96
5.4.220.0070.03215.96
5.4.210.0060.02115.96
5.4.200.0070.03415.83
5.4.190.0100.03615.84
5.4.180.0120.03715.91
5.4.170.0080.03515.95
5.4.160.0060.03815.95
5.4.150.0060.02415.92
5.4.140.0100.03714.60
5.4.130.0040.02914.49
5.4.120.0040.03214.61
5.4.110.0080.03214.56
5.4.100.0050.02014.65
5.4.90.0090.02014.64
5.4.80.0110.01714.64
5.4.70.0060.03614.61
5.4.60.0060.02514.56
5.4.50.0100.03214.63
5.4.40.0090.03714.59
5.4.30.0020.02414.57
5.4.20.0020.03714.61
5.4.10.0100.02814.63
5.4.00.0090.03014.24
5.3.290.0110.03713.79
5.3.280.0060.02913.75
5.3.270.0060.02113.72
5.3.260.0090.03713.76
5.3.250.0090.03613.77
5.3.240.0030.02813.67
5.3.230.0070.02313.70
5.3.220.0040.02213.64
5.3.210.0050.03113.66
5.3.200.0060.02113.73
5.3.190.0090.02013.65
5.3.180.0040.03213.69
5.3.170.0110.03513.74
5.3.160.0050.02913.68
5.3.150.0050.03313.64
5.3.140.0090.03613.71
5.3.130.0060.04013.72
5.3.120.0110.01313.64
5.3.110.0050.03913.67
5.3.100.0050.04113.44
5.3.90.0040.02713.38
5.3.80.0030.03513.38
5.3.70.0040.03113.41
5.3.60.0090.03713.36
5.3.50.0060.03813.34
5.3.40.0050.01913.44
5.3.30.0110.01513.37
5.3.20.0090.03313.29
5.3.10.0080.01513.25
5.3.00.0050.02813.24
5.2.170.0060.03512.19
5.2.160.0030.02012.19
5.2.150.0050.02512.19
5.2.140.0030.01712.19
5.2.130.0120.01812.19
5.2.120.0050.02812.19
5.2.110.0090.01412.19
5.2.100.0040.02812.19
5.2.90.0020.01812.19
5.2.80.0040.01612.19
5.2.70.0060.01812.19
5.2.60.0060.02312.19
5.2.50.0030.03312.19
5.2.40.0070.02712.19
5.2.30.0040.01812.19
5.2.20.0000.02112.19
5.2.10.0000.02012.19
5.2.00.0070.02312.19
5.1.60.0030.01512.19
5.1.50.0040.03012.19
5.1.40.0090.01012.19
5.1.30.0050.02212.19
5.1.20.0030.02012.19
5.1.10.0010.01612.19
5.1.00.0040.02312.19
5.0.50.0030.01712.19
5.0.40.0040.02212.19
5.0.30.0020.02912.19
5.0.20.0020.01712.19
5.0.10.0020.01112.19
5.0.00.0010.01612.19
4.4.90.0030.00812.19
4.4.80.0020.01012.19
4.4.70.0020.01412.19
4.4.60.0020.01112.19
4.4.50.0030.01212.19
4.4.40.0070.00812.19
4.4.30.0000.01212.19
4.4.20.0030.00812.19
4.4.10.0020.00912.19
4.4.00.0020.02612.19
4.3.110.0040.01012.19
4.3.100.0040.00912.19
4.3.90.0030.01212.19
4.3.80.0030.01612.19
4.3.70.0060.00312.19
4.3.60.0030.01812.19
4.3.50.0040.00912.19
4.3.40.0030.02612.19
4.3.30.0000.01012.19
4.3.20.0000.01712.19
4.3.10.0020.01812.19
4.3.00.0030.01512.19

preferences:
28.81 ms | 401 KiB | 5 Q