3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserController { public function getUser($name): User { if(! $user = $this->repo->findByName($name)){ throw UserNotCreatedYetException; } } public function register(Request $req) { try { $user = $this->getUser($name); } catch(UserNotCreatedYetException $e) { $user = new User( $req->get('username') ); } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ndfTh
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   1

Class UserController:
Function getuser:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ndfTh
function name:  getUser
number of ops:  12
compiled vars:  !0 = $name, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        FETCH_OBJ_R                                      ~2      'repo'
          2        INIT_METHOD_CALL                                         ~2, 'findByName'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                           ~4      !1, $3
          6        BOOL_NOT                                         ~5      ~4
          7      > JMPZ                                                     ~5, ->10
    8     8    >   FETCH_CONSTANT                                   ~6      'UserNotCreatedYetException'
          9      > THROW                                         0          ~6
   10    10    >   VERIFY_RETURN_TYPE                                       
         11      > RETURN                                                   null

End of function getuser

Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ndfTh
function name:  register
number of ops:  15
compiled vars:  !0 = $req, !1 = $user, !2 = $name, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   15     1        INIT_METHOD_CALL                                         'getUser'
          2        SEND_VAR_EX                                              !2
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
          5      > JMP                                                      ->14
   16     6  E > > CATCH                                       last         'UserNotCreatedYetException'
   17     7    >   NEW                                              $6      'User'
   18     8        INIT_METHOD_CALL                                         !0, 'get'
          9        SEND_VAL_EX                                              'username'
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR_NO_REF_EX                                       $7
         12        DO_FCALL                                      0          
   17    13        ASSIGN                                                   !1, $6
   21    14    > > RETURN                                                   null

End of function register

End of class UserController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.7 ms | 1395 KiB | 13 Q