3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements \Countable { public function count() : int { return 5; } static public function doFoo() { $foo = new Foo(); assertType('int<0, max>', $foo->count()); } } var_dump(count(new Foo()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ElKMg
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   14     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'Foo'
          3        DO_FCALL                                      0          
          4        COUNT                                            ~2      $0
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class Foo:
Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ElKMg
function name:  count
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   5
    6     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function count

Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ElKMg
function name:  doFoo
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_FCALL_BY_NAME                                       'assertType'
          4        SEND_VAL_EX                                              'int%3C0%2C+max%3E'
          5        INIT_METHOD_CALL                                         !0, 'count'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
   11     9      > RETURN                                                   null

End of function dofoo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.27 ms | 997 KiB | 14 Q