PHP Velho Oeste 2024

Lendo arrays

<?php
class XmlTest {

    function 
test_ref(&$test) {
        
$test "ok";
    }

    function 
test($test) { }

    function 
run() {
        
$ar = array();
        
$this->test_ref($ar[]);
        
var_dump($ar);
        
$this->test($ar[]);
    }
}

$o = new XmlTest();
$o->run();
?>

Ele deve sempre disparar um fatal E_ERROR, porque o array não pode ser usado para leitura em PHP. Isso é um código inválido em PHP 4.4.2 e PHP 5.0.5 ou superior.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top