3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ConectorDatos { static function buscarProductos() { return array( 'Hom' => array( '1VX' => 649.95), 'Sam' => array( 'Note2' => 699.95, 'Gala' => 499.95, 'Gel' => 249.95), 'olivi' => array( 'Lumia' => 999.95), 'Obvow' => array( 'One Plus One' => 299.50) ); } } ?> $productos = ConectorDatos::buscarProductos(); <div id="productos"> <ul class="telefonoEspecifico"> <li>Marca:<?php echo $producto['Hom']['1VX'];?></li> <select name="marc" id="marc4"> <?php foreach($productos as $producto) { echo "<option value='2'>".$producto['Sam']['Note2'] . "</option>"; echo "<option value='3'>".$producto['Sam']['Gala'] . "</option>"; echo "<option value='4'>".$producto['Sam']['Gel'] . "</option>"; } ?> </select> <li>Modelo:<?php echo $producto['olivi']['Lumia'];?></li> <li>Precio:<?php echo $producto['Obvow']['One Plus One'];?></li>
Output for git.master, git.master_jit
$productos = ConectorDatos::buscarProductos(); <div id="productos"> <ul class="telefonoEspecifico"> <li>Marca: Warning: Undefined variable $producto in /in/HGiJ4 on line 19 Warning: Trying to access array offset on value of type null in /in/HGiJ4 on line 19 Warning: Trying to access array offset on value of type null in /in/HGiJ4 on line 19 </li> <select name="marc" id="marc4"> Warning: Undefined variable $productos in /in/HGiJ4 on line 23 Warning: foreach() argument must be of type array|object, null given in /in/HGiJ4 on line 23 </select> <li>Modelo: Warning: Undefined variable $producto in /in/HGiJ4 on line 30 Warning: Trying to access array offset on value of type null in /in/HGiJ4 on line 30 Warning: Trying to access array offset on value of type null in /in/HGiJ4 on line 30 </li> <li>Precio: Warning: Undefined variable $producto in /in/HGiJ4 on line 31 Warning: Trying to access array offset on value of type null in /in/HGiJ4 on line 31 Warning: Trying to access array offset on value of type null in /in/HGiJ4 on line 31 </li>
Output for rfc.property-hooks
$productos = ConectorDatos::buscarProductos(); <div id="productos"> <ul class="telefonoEspecifico"> <li>Marca: Warning: Undefined variable $producto in /in/HGiJ4 on line 19 Warning: Trying to access array offset on null in /in/HGiJ4 on line 19 Warning: Trying to access array offset on null in /in/HGiJ4 on line 19 </li> <select name="marc" id="marc4"> Warning: Undefined variable $productos in /in/HGiJ4 on line 23 Warning: foreach() argument must be of type array|object, null given in /in/HGiJ4 on line 23 </select> <li>Modelo: Warning: Undefined variable $producto in /in/HGiJ4 on line 30 Warning: Trying to access array offset on null in /in/HGiJ4 on line 30 Warning: Trying to access array offset on null in /in/HGiJ4 on line 30 </li> <li>Precio: Warning: Undefined variable $producto in /in/HGiJ4 on line 31 Warning: Trying to access array offset on null in /in/HGiJ4 on line 31 Warning: Trying to access array offset on null in /in/HGiJ4 on line 31 </li>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
49.88 ms | 403 KiB | 8 Q