3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyCountable implements Countable { public function count($mySpecialFilterArgument = null) { if($mySpecialFilterArgument === null) { // expect that we were called from count($myCountable) var_dump(0); } else { // expect that we manually called $myCountable->count($mySpecialFilterArgument) var_dump(1); } } } $myCountable = new MyCountable; $myCountable->count(1); count($myCountable); count($myCountable, COUNT_NORMAL); count($myCountable, COUNT_RECURSIVE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4O9nA
function name:  (null)
number of ops:  18
compiled vars:  !0 = $myCountable
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                                'mycountable'
   16     1        NEW                                                  $1      'MyCountable'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   17     4        INIT_METHOD_CALL                                             !0, 'count'
          5        SEND_VAL_EX                                                  1
          6        DO_FCALL                                          0          
   18     7        COUNT                                                ~5      !0
          8        FREE                                                         ~5
   19     9        INIT_FCALL                                                   'count'
         10        SEND_VAR                                                     !0
         11        SEND_VAL                                                     0
         12        DO_ICALL                                                     
   20    13        INIT_FCALL                                                   'count'
         14        SEND_VAR                                                     !0
         15        SEND_VAL                                                     1
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Class MyCountable:
Function count:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
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: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4O9nA
function name:  count
number of ops:  11
compiled vars:  !0 = $mySpecialFilterArgument
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                            !0      null
    6     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~1, ->7
    8     3    >   INIT_FCALL                                                   'var_dump'
          4        SEND_VAL                                                     0
          5        DO_ICALL                                                     
    6     6      > JMP                                                          ->10
   11     7    >   INIT_FCALL                                                   'var_dump'
          8        SEND_VAL                                                     1
          9        DO_ICALL                                                     
   13    10    > > RETURN                                                       null

End of function count

End of class MyCountable.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
179.08 ms | 3305 KiB | 15 Q