3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('w','z','u','o','ul.'); $titleOld = 'Testing w it\'s ul. here'; $words = explode(' ', $titleOld); $titleNew = trim(join('', array_map(function($word) use ($array) { return $word . (in_array($word, $array) ? "&nbsp;" : ' '); }, $words))); echo $titleNew; // "Testing w&nbsp;it's ul.&nbsp;here"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3HffW
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $titleOld, !2 = $words, !3 = $titleNew
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'Testing+w+it%27s+ul.+here'
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    7     7        INIT_FCALL                                               'trim'
          8        INIT_FCALL                                               'join'
          9        SEND_VAL                                                 ''
         10        INIT_FCALL                                               'array_map'
         11        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
         12        BIND_LEXICAL                                             ~8, !0
    9    13        SEND_VAL                                                 ~8
         14        SEND_VAR                                                 !2
    7    15        DO_ICALL                                         $9      
    9    16        SEND_VAR                                                 $9
    7    17        DO_ICALL                                         $10     
    9    18        SEND_VAR                                                 $10
    7    19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   11    21        ECHO                                                     !3
         22      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3HffW
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $word, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    8     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->9
          7    >   QM_ASSIGN                                        ~3      '%26nbsp%3B'
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~3      '+'
         10    >   CONCAT                                           ~4      !0, ~3
         11      > RETURN                                                   ~4
    9    12*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.94 ms | 1005 KiB | 18 Q