3v4l.org

run code in 300+ PHP versions simultaneously
<?php $words = 'good bad cupid banana apple'; $text = 'Sometimes I travel to the good places that are good, and never the bad places that are bad. For example I want to visit the heavens and meet a cupid eating an apple. Perhaps I will see mythological creatures eating other fruits like apples, bananas, and other good fruits.'; $expr = explode("\n", $words); $expr = array_map(function ($v) { return preg_quote(trim($v)); }, $expr); $expr = '/('. implode('|', $expr) . ')/i'; preg_match_all($expr, $text, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GlUk1
function name:  (null)
number of ops:  29
compiled vars:  !0 = $words, !1 = $text, !2 = $expr, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'good%0Abad+%0Acupid%0Abanana%0Aapple'
    8     1        ASSIGN                                                   !1, 'Sometimes+I+travel+to+the+good+places+that+are+good%2C+and+never+the+bad+places+that+are+bad.+For+example+I+want+to+visit+the+heavens+and+meet+a+cupid+eating+an+apple.+Perhaps+I+will+see+mythological+creatures+eating+other+fruits+like+apples%2C+bananas%2C+and+other+good+fruits.'
   10     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   11     7        INIT_FCALL                                               'array_map'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGlUk1%3A11%240'
          9        SEND_VAL                                                 ~8
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
   12    13        INIT_FCALL                                               'implode'
         14        SEND_VAL                                                 '%7C'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $11     
         17        CONCAT                                           ~12     '%2F%28', $11
         18        CONCAT                                           ~13     ~12, '%29%2Fi'
         19        ASSIGN                                                   !2, ~13
   13    20        INIT_FCALL                                               'preg_match_all'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !1
         23        SEND_REF                                                 !3
         24        DO_ICALL                                                 
   15    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGlUk1%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GlUk1
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'preg_quote'
          2        INIT_FCALL                                               'trim'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
          8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGlUk1%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.16 ms | 1400 KiB | 27 Q