3v4l.org

run code in 300+ PHP versions simultaneously
<?php class GeoCoder { protected $latitude; protected $longitude; public $distance; public function __construct($lat,$long,$dist) { $this->latitude = $lat; $this->longitude = $long; $this->distance = $dist; } } $o1 = new GeoCoder(-22.43,-46.81,1500.00); $o2 = new GeoCoder(-22.42,-46.82,1740.00); $o3 = new GeoCoder(-21.43,-46.80,152.00); $nu = null; if ($o1->distance > $o2->distance) { $nu[0] = $o2; $nu[1] = $o1; } else if ($o1->distance > $o3->distance) { $nu[0] = $o3->distance; $nu[2] = $o1->distance; } else { $nu[0] = $o1; $nu[1] = $o2; } var_dump($nu);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 39
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AGaHi
function name:  (null)
number of ops:  47
compiled vars:  !0 = $o1, !1 = $o2, !2 = $o3, !3 = $nu
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $4      'GeoCoder'
          1        SEND_VAL_EX                                              -22.43
          2        SEND_VAL_EX                                              -46.81
          3        SEND_VAL_EX                                              1500
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
   16     6        NEW                                              $7      'GeoCoder'
          7        SEND_VAL_EX                                              -22.42
          8        SEND_VAL_EX                                              -46.82
          9        SEND_VAL_EX                                              1740
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   17    12        NEW                                              $10     'GeoCoder'
         13        SEND_VAL_EX                                              -21.43
         14        SEND_VAL_EX                                              -46.8
         15        SEND_VAL_EX                                              152
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $10
   19    18        ASSIGN                                                   !3, null
   20    19        FETCH_OBJ_R                                      ~14     !0, 'distance'
         20        FETCH_OBJ_R                                      ~15     !1, 'distance'
         21        IS_SMALLER                                               ~15, ~14
         22      > JMPZ                                                     ~16, ->28
   21    23    >   ASSIGN_DIM                                               !3, 0
         24        OP_DATA                                                  !1
   22    25        ASSIGN_DIM                                               !3, 1
         26        OP_DATA                                                  !0
         27      > JMP                                                      ->43
   25    28    >   FETCH_OBJ_R                                      ~19     !0, 'distance'
         29        FETCH_OBJ_R                                      ~20     !2, 'distance'
         30        IS_SMALLER                                               ~20, ~19
         31      > JMPZ                                                     ~21, ->39
   26    32    >   FETCH_OBJ_R                                      ~23     !2, 'distance'
         33        ASSIGN_DIM                                               !3, 0
         34        OP_DATA                                                  ~23
   27    35        FETCH_OBJ_R                                      ~25     !0, 'distance'
         36        ASSIGN_DIM                                               !3, 2
         37        OP_DATA                                                  ~25
         38      > JMP                                                      ->43
   31    39    >   ASSIGN_DIM                                               !3, 0
         40        OP_DATA                                                  !0
   32    41        ASSIGN_DIM                                               !3, 1
         42        OP_DATA                                                  !1
   35    43    >   INIT_FCALL                                               'var_dump'
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Class GeoCoder:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AGaHi
function name:  __construct
number of ops:  10
compiled vars:  !0 = $lat, !1 = $long, !2 = $dist
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN_OBJ                                               'latitude'
          4        OP_DATA                                                  !0
   10     5        ASSIGN_OBJ                                               'longitude'
          6        OP_DATA                                                  !1
   11     7        ASSIGN_OBJ                                               'distance'
          8        OP_DATA                                                  !2
   12     9      > RETURN                                                   null

End of function __construct

End of class GeoCoder.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.72 ms | 1392 KiB | 15 Q