3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Pont { public float $longueur; public float $largeur; public function getSurface(): float { return $this->longueur * $this->largeur; } } $towerBridge = new Pont; $towerBridge->longueur = 286.0; $towerBridge->largeur = 15.0; $manhattanBridge = new Pont; $manhattanBridge->longueur = 2089.0; $manhattanBridge->largeur = 36.6; $towerBridgeSurface = $towerBridge->getSurface(); $manhattanBridgeSurface = $manhattanBridge->getSurface(); var_dump($towerBridgeSurface); var_dump($manhattanBridgeSurface);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FL2nD
function name:  (null)
number of ops:  27
compiled vars:  !0 = $towerBridge, !1 = $manhattanBridge, !2 = $towerBridgeSurface, !3 = $manhattanBridgeSurface
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $4      'Pont'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   17     3        ASSIGN_OBJ                                               !0, 'longueur'
          4        OP_DATA                                                  286
   18     5        ASSIGN_OBJ                                               !0, 'largeur'
          6        OP_DATA                                                  15
   20     7        NEW                                              $9      'Pont'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $9
   21    10        ASSIGN_OBJ                                               !1, 'longueur'
         11        OP_DATA                                                  2089
   22    12        ASSIGN_OBJ                                               !1, 'largeur'
         13        OP_DATA                                                  36.6
   24    14        INIT_METHOD_CALL                                         !0, 'getSurface'
         15        DO_FCALL                                      0  $14     
         16        ASSIGN                                                   !2, $14
   25    17        INIT_METHOD_CALL                                         !1, 'getSurface'
         18        DO_FCALL                                      0  $16     
         19        ASSIGN                                                   !3, $16
   27    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   28    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class Pont:
Function getsurface:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FL2nD
function name:  getSurface
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'longueur'
          1        FETCH_OBJ_R                                      ~1      'largeur'
          2        MUL                                              ~2      ~0, ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   13     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function getsurface

End of class Pont.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.05 ms | 1452 KiB | 14 Q