3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class HelloWorld { public function sayHello(int|string $intOrString): void { try { $this->getInt($intOrString); } catch (TypeError) { } } /** @throws void */ public function getInt(int $int): int { return $int; } } (new HelloWorld())->sayHello('foo');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/46LqD
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $0      'HelloWorld'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'sayHello'
          3        SEND_VAL_EX                                              'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class HelloWorld:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
filename:       /in/46LqD
function name:  sayHello
number of ops:  7
compiled vars:  !0 = $intOrString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    8     1        INIT_METHOD_CALL                                         'getInt'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->6
    9     5  E > > CATCH                                       last         'TypeError'
   12     6    > > RETURN                                                   null

End of function sayhello

Function getint:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/46LqD
function name:  getInt
number of ops:  5
compiled vars:  !0 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
   18     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getint

End of class HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.45 ms | 1007 KiB | 13 Q