3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TXT /some text/ TXT; $pattern = "/"; $pattern = preg_quote($pattern, '/'); $matches = array(); $match = preg_match_all("/" . $pattern . "/mi", $text, $matches); var_dump($match, $matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6NnuP
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $pattern, !2 = $matches, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%2Fsome+text%2F%0A'
    9     1        ASSIGN                                                   !1, '%2F'
   10     2        INIT_FCALL                                               'preg_quote'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%2F'
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
   12     7        ASSIGN                                                   !2, <array>
   13     8        INIT_FCALL                                               'preg_match_all'
          9        CONCAT                                           ~9      '%2F', !1
         10        CONCAT                                           ~10     ~9, '%2Fmi'
         11        SEND_VAL                                                 ~10
         12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !2
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !3, $11
   15    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.89 ms | 1395 KiB | 19 Q