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() { $this->nextLatgitude()->next(); return $this->nextLatitude()->current(); } private function nextLongitude() { yield from $this->longitudes; } public function getLongitude() { $this->nextLongitude()->next(); return $this->nextLongitude()->current(); } } $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/NNHQl
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/NNHQl
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/NNHQl
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NNHQl
function name:  getLatitude
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'nextLatgitude'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'next'
          3        DO_FCALL                                      0          
   15     4        INIT_METHOD_CALL                                         'nextLatitude'
          5        DO_FCALL                                      0  $2      
          6        INIT_METHOD_CALL                                         $2, 'current'
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   16     9*     > 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/NNHQl
function name:  nextLongitude
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   GENERATOR_CREATE                                         
   19     1        FETCH_OBJ_R                                      ~0      'longitudes'
          2        YIELD_FROM                                       ~1      ~0
          3        FREE                                                     ~1
   20     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/NNHQl
function name:  getLongitude
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'nextLongitude'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'next'
          3        DO_FCALL                                      0          
   23     4        INIT_METHOD_CALL                                         'nextLongitude'
          5        DO_FCALL                                      0  $2      
          6        INIT_METHOD_CALL                                         $2, 'current'
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   24     9*     > RETURN                                                   null

End of function getlongitude

End of class testing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.41 ms | 1390 KiB | 13 Q