3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class Pont { private const UNITE = 'm²'; private float $longueur; private float $largeur; public function getSurface(): string { return ($this->longueur * $this->largeur) . self::UNITE; } public function setLongueur(float $longueur) { $this->longueur = $longueur; } public function setLargeur(float $largeur) { $this->largeur = $largeur; } } $towerBridge = new Pont; $towerBridge->setLongueur(286.0); $towerBridge->setLargeur(15.0); echo $towerBridge->getSurface();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHoLh
function name:  (null)
number of ops:  13
compiled vars:  !0 = $towerBridge
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $1      'Pont'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   26     3        INIT_METHOD_CALL                                             !0, 'setLongueur'
          4        SEND_VAL_EX                                                  286
          5        DO_FCALL                                          0          
   27     6        INIT_METHOD_CALL                                             !0, 'setLargeur'
          7        SEND_VAL_EX                                                  15
          8        DO_FCALL                                          0          
   29     9        INIT_METHOD_CALL                                             !0, 'getSurface'
         10        DO_FCALL                                          0  $6      
         11        ECHO                                                         $6
         12      > RETURN                                                       1

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

End of function getsurface

Function setlongueur:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHoLh
function name:  setLongueur
number of ops:  4
compiled vars:  !0 = $longueur
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   17     1        ASSIGN_OBJ                                                   'longueur'
          2        OP_DATA                                                      !0
   18     3      > RETURN                                                       null

End of function setlongueur

Function setlargeur:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHoLh
function name:  setLargeur
number of ops:  4
compiled vars:  !0 = $largeur
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   21     1        ASSIGN_OBJ                                                   'largeur'
          2        OP_DATA                                                      !0
   22     3      > RETURN                                                       null

End of function setlargeur

End of class Pont.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.93 ms | 2003 KiB | 13 Q