3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testing { protected $latitudes = [2,4,6,8,10]; protected $longitudes = [3,6,9,12,15]; public function __construct() { } private function nextLatitude() { yield from $this->latitudes; } public function getLatitude() { foreach($this->nextLatitude() as $latitude) { return $latitude; } } private function nextLongitude() { yield from $this->longitudes; } public function getLongitude() { return $this->nextLongitude(); } } $x = new testing(); echo $x->getLatitude(), PHP_EOL; echo $x->getLongitude(), PHP_EOL, PHP_EOL; echo $x->getLatitude(), PHP_EOL; echo $x->getLongitude(), PHP_EOL, PHP_EOL; echo $x->getLatitude(), PHP_EOL; echo $x->getLongitude(), PHP_EOL, PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C3TnI
function name:  (null)
number of ops:  31
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'testing'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   29     3        INIT_METHOD_CALL                                         !0, 'getLatitude'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6        ECHO                                                     '%0A'
   30     7        INIT_METHOD_CALL                                         !0, 'getLongitude'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
         10        ECHO                                                     '%0A'
         11        ECHO                                                     '%0A'
   32    12        INIT_METHOD_CALL                                         !0, 'getLatitude'
         13        DO_FCALL                                      0  $6      
         14        ECHO                                                     $6
         15        ECHO                                                     '%0A'
   33    16        INIT_METHOD_CALL                                         !0, 'getLongitude'
         17        DO_FCALL                                      0  $7      
         18        ECHO                                                     $7
         19        ECHO                                                     '%0A'
         20        ECHO                                                     '%0A'
   35    21        INIT_METHOD_CALL                                         !0, 'getLatitude'
         22        DO_FCALL                                      0  $8      
         23        ECHO                                                     $8
         24        ECHO                                                     '%0A'
   36    25        INIT_METHOD_CALL                                         !0, 'getLongitude'
         26        DO_FCALL                                      0  $9      
         27        ECHO                                                     $9
         28        ECHO                                                     '%0A'
         29        ECHO                                                     '%0A'
         30      > RETURN                                                   1

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

End of function __construct

Function nextlatitude:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/C3TnI
function name:  nextLatitude
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   GENERATOR_CREATE                                         
   11     1        FETCH_OBJ_R                                      ~0      'latitudes'
          2        YIELD_FROM                                       ~1      ~0
          3        FREE                                                     ~1
   12     4      > GENERATOR_RETURN                                         

End of function nextlatitude

Function getlatitude:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/C3TnI
function name:  getLatitude
number of ops:  9
compiled vars:  !0 = $latitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'nextLatitude'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->7
          3    > > FE_FETCH_R                                               $2, !0, ->7
   15     4    >   FE_FREE                                                  $2
          5      > RETURN                                                   !0
   14     6*       JMP                                                      ->3
          7    >   FE_FREE                                                  $2
   17     8      > RETURN                                                   null

End of function getlatitude

Function nextlongitude:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/C3TnI
function name:  nextLongitude
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   GENERATOR_CREATE                                         
   20     1        FETCH_OBJ_R                                      ~0      'longitudes'
          2        YIELD_FROM                                       ~1      ~0
          3        FREE                                                     ~1
   21     4      > GENERATOR_RETURN                                         

End of function nextlongitude

Function getlongitude:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C3TnI
function name:  getLongitude
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_METHOD_CALL                                         'nextLongitude'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   24     3*     > RETURN                                                   null

End of function getlongitude

End of class testing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.7 ms | 1390 KiB | 13 Q