3v4l.org

run code in 300+ 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:  24
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'
   10     5        INIT_FCALL                                               'implode'
   11     6        SEND_VAL                                                 '%2C+'
   12     7        INIT_FCALL                                               'array_map'
   13     8        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          9        BIND_LEXICAL                                             ~6, !2
   17    10        SEND_VAL                                                 ~6
   18    11        INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '%2C'
         13        FETCH_OBJ_R                                      ~7      !0, 'interests'
         14        SEND_VAL                                                 ~7
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
   12    18        DO_ICALL                                         $9      
   18    19        SEND_VAR                                                 $9
   10    20        DO_ICALL                                         $10     
   18    21        SEND_VAR                                                 $10
    8    22        DO_ICALL                                                 
   21    23      > RETURN                                                   1


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

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.26 ms | 1022 KiB | 20 Q