3v4l.org

run code in 300+ PHP versions simultaneously
<?php function endswith($string, $test) { $strlen = strlen($string); $testlen = strlen($test); if ($testlen > $strlen) return false; return substr_compare($string, $test, -$testlen) === 0; } if(false == endswith('http://localhost/events/10','/events/')){ echo 'true'; } else{ echo 'false'; } $testlen = strlen('events'); if(false == substr_compare('http://localhost/events/10','/events/',-)){ echo 'true'; } else{ echo 'false'; }
Output for 5.3.0 - 5.3.26, 5.4.0 - 5.4.16
Parse error: syntax error, unexpected ')' in /in/cZlHv on line 20
Process exited with code 255.

preferences:
178.21 ms | 1395 KiB | 51 Q