3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "Darsstar"; $b = $a . "\n"; if (preg_match('/^[A-Z][a-z]++$/', $a)) { echo 'A zonder D' . PHP_EOL; } if (preg_match('/^[A-Z][a-z]++$/', $b)) { echo 'B zonder D' . PHP_EOL; } if (preg_match('/^[A-Z][a-z]++$/D', $a)) { echo 'A met D' . PHP_EOL; } if (preg_match('/^[A-Z][a-z]++$/D', $b)) { echo 'B met D' . PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
A zonder D B zonder D A met D
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VcgC1 on line 8 A zonder DPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VcgC1 on line 13 B zonder DPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VcgC1 on line 18 A met DPHP_EOL