3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exception = ['will not'=>'will&nbs;pnot']; $string = 'They will not begin'; function r($s, $a){ $string = strtr($string, $exception); $array = explode(' ', $string); $array = array_combine(array_values($array), array_values($array)); $array = array_replace($array, array_intersect($array, array_flip($exception))); return array_values($array); } var_dump(f($string, $exception));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JpY5G
function name:  (null)
number of ops:  10
compiled vars:  !0 = $exception, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'They+will+not+begin'
   13     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL_BY_NAME                                       'f'
          4        SEND_VAR_EX                                              !1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function r:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JpY5G
function name:  r
number of ops:  40
compiled vars:  !0 = $s, !1 = $a, !2 = $string, !3 = $exception, !4 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'strtr'
          3        SEND_VAR                                                 !2
          4        SEND_VAR                                                 !3
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    7     7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '+'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !4, $7
    8    12        INIT_FCALL                                               'array_combine'
         13        INIT_FCALL                                               'array_values'
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        INIT_FCALL                                               'array_values'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                         $11     
         22        ASSIGN                                                   !4, $11
    9    23        INIT_FCALL                                               'array_replace'
         24        SEND_VAR                                                 !4
         25        INIT_FCALL                                               'array_intersect'
         26        SEND_VAR                                                 !4
         27        INIT_FCALL                                               'array_flip'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $13     
         30        SEND_VAR                                                 $13
         31        DO_ICALL                                         $14     
         32        SEND_VAR                                                 $14
         33        DO_ICALL                                         $15     
         34        ASSIGN                                                   !4, $15
   10    35        INIT_FCALL                                               'array_values'
         36        SEND_VAR                                                 !4
         37        DO_ICALL                                         $17     
         38      > RETURN                                                   $17
   11    39*     > RETURN                                                   null

End of function r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.32 ms | 1405 KiB | 29 Q