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[] = $o2; $nu[] = $o1; } if ($o2->distance > $o3->distance) { $nu[1] = $o3; $nu[] = $o2; } var_dump($nu);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 27
filename:       /in/t2G6R
function name:  (null)
number of ops:  39
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, ->27
   21    23    >   ASSIGN_DIM                                               !3
         24        OP_DATA                                                  !1
   22    25        ASSIGN_DIM                                               !3
         26        OP_DATA                                                  !0
   24    27    >   FETCH_OBJ_R                                      ~19     !1, 'distance'
         28        FETCH_OBJ_R                                      ~20     !2, 'distance'
         29        IS_SMALLER                                               ~20, ~19
         30      > JMPZ                                                     ~21, ->35
   25    31    >   ASSIGN_DIM                                               !3, 1
         32        OP_DATA                                                  !2
   26    33        ASSIGN_DIM                                               !3
         34        OP_DATA                                                  !1
   28    35    >   INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Class GeoCoder:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t2G6R
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:
173.19 ms | 1404 KiB | 15 Q