3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Router { private array $routes; public function __construct(array $routes) { $this->routes = $routes; } public function route(string $path): ?Route { foreach ($this->routes as $route) { if ($route->get('url') === $path) { $result = $route; } } //Не дописано if ($result) { return $result; } else { } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PmVCS
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E > > RETURN                                                   1

Class Router:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PmVCS
function name:  __construct
number of ops:  4
compiled vars:  !0 = $routes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'routes'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function route:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/PmVCS
function name:  route
number of ops:  18
compiled vars:  !0 = $path, !1 = $route, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_OBJ_R                                      ~3      'routes'
          2      > FE_RESET_R                                       $4      ~3, ->11
          3    > > FE_FETCH_R                                               $4, !1, ->11
   15     4    >   INIT_METHOD_CALL                                         !1, 'get'
          5        SEND_VAL_EX                                              'url'
          6        DO_FCALL                                      0  $5      
          7        IS_IDENTICAL                                             !0, $5
          8      > JMPZ                                                     ~6, ->10
   16     9    >   ASSIGN                                                   !2, !1
   14    10    > > JMP                                                      ->3
         11    >   FE_FREE                                                  $4
   21    12      > JMPZ                                                     !2, ->16
   22    13    >   VERIFY_RETURN_TYPE                                       !2
         14      > RETURN                                                   !2
   21    15*       JMP                                                      ->16
   26    16    >   VERIFY_RETURN_TYPE                                       
         17      > RETURN                                                   null

End of function route

End of class Router.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.79 ms | 996 KiB | 13 Q