3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class Pont { private const SURFACE_TEXT = 'Ce pont mesure %dm'; private float $longueur; private float $largeur; public function setLongueur(float $longueur): void { if ($longueur < 0) { trigger_error( 'La longueur est trop courte. (min 1)', E_USER_ERROR ); } $this->longueur = $longueur; } public function getLongueur(): float { return $this->longueur; } public function setLargeur(float $largeur): void { if ($largeur < 0) { trigger_error( 'La largeur est trop courte. (min 1)', E_USER_ERROR ); } $this->largeur = $largeur; } public function getLargeur(): float { return $this->largeur; } public function getSurface(): float { return $this->longueur * $this->largeur; } public function printSurface(): void { echo sprintf(self::SURFACE_TEXT, $this->getSurface()); } } $towerBridge = new Pont; $towerBridge->setLongueur(286.0); $towerBridge->setLargeur(15.0); $towerBridge->printSurface();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hPOgW
function name:  (null)
number of ops:  12
compiled vars:  !0 = $towerBridge
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   57     0  E >   NEW                                                  $1      'Pont'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   58     3        INIT_METHOD_CALL                                             !0, 'setLongueur'
          4        SEND_VAL_EX                                                  286
          5        DO_FCALL                                          0          
   59     6        INIT_METHOD_CALL                                             !0, 'setLargeur'
          7        SEND_VAL_EX                                                  15
          8        DO_FCALL                                          0          
   61     9        INIT_METHOD_CALL                                             !0, 'printSurface'
         10        DO_FCALL                                          0          
         11      > RETURN                                                       1

Class Pont:
Function setlongueur:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/hPOgW
function name:  setLongueur
number of ops:  10
compiled vars:  !0 = $longueur
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   14     1        IS_SMALLER                                                   !0, 0
          2      > JMPZ                                                         ~1, ->7
   15     3    >   INIT_FCALL                                                   'trigger_error'
   16     4        SEND_VAL                                                     'La+longueur+est+trop+courte.+%28min+1%29'
   17     5        SEND_VAL                                                     256
   15     6        DO_ICALL                                                     
   21     7    >   ASSIGN_OBJ                                                   'longueur'
          8        OP_DATA                                                      !0
   22     9      > RETURN                                                       null

End of function setlongueur

Function getlongueur:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hPOgW
function name:  getLongueur
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_R                                          ~0      'longueur'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   27     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function getlongueur

Function setlargeur:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/hPOgW
function name:  setLargeur
number of ops:  10
compiled vars:  !0 = $largeur
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   RECV                                                 !0      
   31     1        IS_SMALLER                                                   !0, 0
          2      > JMPZ                                                         ~1, ->7
   32     3    >   INIT_FCALL                                                   'trigger_error'
   33     4        SEND_VAL                                                     'La+largeur+est+trop+courte.+%28min+1%29'
   34     5        SEND_VAL                                                     256
   32     6        DO_ICALL                                                     
   38     7    >   ASSIGN_OBJ                                                   'largeur'
          8        OP_DATA                                                      !0
   39     9      > RETURN                                                       null

End of function setlargeur

Function getlargeur:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hPOgW
function name:  getLargeur
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   43     0  E >   FETCH_OBJ_R                                          ~0      'largeur'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   44     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function getlargeur

Function getsurface:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hPOgW
function name:  getSurface
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   48     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
   49     5*       VERIFY_RETURN_TYPE                                           
          6*     > RETURN                                                       null

End of function getsurface

Function printsurface:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hPOgW
function name:  printSurface
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   53     0  E >   INIT_METHOD_CALL                                             'getSurface'
          1        DO_FCALL                                          0  $0      
          2        ROPE_INIT                                         3  ~3      'Ce+pont+mesure+'
          3        CAST                                              4  ~1      $0
          4        ROPE_ADD                                          1  ~3      ~3, ~1
          5        ROPE_END                                          2  ~2      ~3, 'm'
          6        ECHO                                                         ~2
   54     7      > RETURN                                                       null

End of function printsurface

End of class Pont.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.23 ms | 2014 KiB | 14 Q