3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extractSpecs($description) { $matches = array(); $result = preg_match('/.*<h2>.*?Specificaties.*?<\/h2>\s?(<p>.*?<\/p>).*/is', $description, $matches); if ($result) { return $matches[1]; } else { return ''; } } $specs = '<p>Deze mat zwarte VinZ fashionhelm is goedgekeurd volgens de Europese richtlijnen en kan gedragen worden als scooterhelm of motorhelm om veilig op een scooter, brommer of motor over straat te rijden. De helm beschikt over een fashion vizier, die omhoog kan worden geschoven en biedt een uitstekende pasvorm. De oorpads zijn uitneembaar en kunnen gewassen worden. Bovendien beschikt deze Vinz helm over een gebruiksvriendelijke sluiting.</p> <h2><span style="font-size: small;"><strong>Specificaties Vinz Fashion Helm Uni - Matzwart:</strong></span></h2> <p>- ECE-22.05 goedgekeurd voor Motoren, Scooters, Brommers, Quads, Trikes, etc<br /> - Uitstekende pasvorm.<br /> - Comfort binnenvoering.<br />- Vizier kan omhoog geschoven worden<br /> - Micrometic kinband snelsluiting.<br /> - Past in de meeste buddy`s<br />- Uitneembare en wasbare oorpads<br />- Zonder gereedschap vizer erafhalen of verwisselen. <br /> - Gewicht 1100 gram<br /> - Leverbaar in de maten XS-S-M-L-XL</p> <p>Bepaal uw maat aan de hand van de <a href="http://www.helmonline.nl/matentabel" target="_blank">matentabel</a></p> <p><strong>Let op</strong>: Deze helm kan klein vallen, neem bij twijfel een maatje groter!&nbsp;</p>'; echo $extractSpecs($specs);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined variable $extractSpecs in /in/oiIVP on line 19 Fatal error: Uncaught Error: Value of type null is not callable in /in/oiIVP:19 Stack trace: #0 {main} thrown in /in/oiIVP on line 19
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: extractSpecs in /in/oiIVP on line 19 Fatal error: Uncaught Error: Function name must be a string in /in/oiIVP:19 Stack trace: #0 {main} thrown in /in/oiIVP on line 19
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Function name must be a string in /in/oiIVP:19 Stack trace: #0 {main} thrown in /in/oiIVP on line 19
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Notice: Undefined variable: extractSpecs in /in/oiIVP on line 19 Fatal error: Function name must be a string in /in/oiIVP on line 19
Process exited with code 255.

preferences:
270.78 ms | 402 KiB | 376 Q