3v4l.org

run code in 500+ PHP versions simultaneously
<?php $usr = (object)[ 'interests' => 'Cats,Dogs,Monkeys,Praying Mantises,Octopuses,Arowanas,Sloths,Tasmanian Tigers' ]; $showMax = 3; printf( 'Interested in: %s', implode( ', ', array_map( fn($v) => sprintf( '<span>%s</span>%s', strtok($v, ','), ($more = substr_count($v, ',')) ? " (+$more)" : '' ), explode(',', $usr->interests, $showMax) ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TQE4I
function name:  (null)
number of ops:  21
compiled vars:  !0 = $usr, !1 = $showMax, !2 = $more
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   CAST                                              8  ~3      <array>
    3     1        ASSIGN                                                       !0, ~3
    6     2        ASSIGN                                                       !1, 3
    8     3        INIT_FCALL                                                   'printf'
    9     4        SEND_VAL                                                     'Interested+in%3A+%25s'
   12     5        INIT_FCALL                                                   'array_map'
   13     6        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          7        BIND_LEXICAL                                                 ~6, !2
   17     8        SEND_VAL                                                     ~6
   18     9        INIT_FCALL                                                   'explode'
         10        SEND_VAL                                                     '%2C'
         11        FETCH_OBJ_R                                          ~7      !0, 'interests'
         12        SEND_VAL                                                     ~7
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                             $8      
         15        SEND_VAR                                                     $8
   12    16        DO_ICALL                                             $9      
   10    17        FRAMELESS_ICALL_2                implode             ~10     '%2C+', $9
   18    18        SEND_VAL                                                     ~10
    8    19        DO_ICALL                                                     
   21    20      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TQE4I
function name:  {closure:/in/TQE4I:13}
number of ops:  24
compiled vars:  !0 = $v, !1 = $more
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   15     2        INIT_FCALL                                                   'strtok'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     '%2C'
          5        DO_ICALL                                             $2      
   16     6        INIT_FCALL                                                   'substr_count'
          7        SEND_VAR                                                     !0
          8        SEND_VAL                                                     '%2C'
          9        DO_ICALL                                             $3      
         10        ASSIGN                                               ~4      !1, $3
         11      > JMPZ                                                         ~4, ->17
         12    >   ROPE_INIT                                         3  ~6      '+%28%2B'
         13        ROPE_ADD                                          1  ~6      ~6, !1
         14        ROPE_END                                          2  ~5      ~6, '%29'
         15        QM_ASSIGN                                            ~8      ~5
         16      > JMP                                                          ->18
         17    >   QM_ASSIGN                                            ~8      ''
         18    >   ROPE_INIT                                         4  ~10     '%3Cspan%3E'
         19        ROPE_ADD                                          1  ~10     ~10, $2
         20        ROPE_ADD                                          2  ~10     ~10, '%3C%2Fspan%3E'
         21        ROPE_END                                          3  ~9      ~10, ~8
         22      > RETURN                                                       ~9
   17    23*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.85 ms | 1465 KiB | 18 Q