3v4l.org

run code in 300+ 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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TOYhu
function name:  (null)
number of ops:  14
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                                                 
         13      > 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/TOYhu
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      > 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.0.0


preferences:
155.74 ms | 1396 KiB | 17 Q