Warning: Missing 1 argüman

0 Cevap php

Ben bu hatayı alıyorum neden herhangi bir fikir:

Warning: Missing argument 1 for person::__construct(), called in /home/fishbein/public_html/dev/OOP/index.php on line 5 and defined in /home/fishbein/public_html/dev/OOP/class_lib.php on line 6

Warning: Missing argument 1 for person::__construct(), called in /home/fishbein/public_html/dev/OOP/index.php on line 6 and defined in /home/fishbein/public_html/dev/OOP/class_lib.php on line 6

Bu kod ile:

<?
    class person {

            var $name;

            function __construct($persons_name) {       
            $this->name = $persons_name;        
            }

            function set_name($new_name) {
                $this->name = $new_name;
            }

            function get_name() {
                return $this->name;
            }

    }
?>

Ben de indeks dosyasında bu kullanıyorum:

$tyler = new person("Tyler");

0 Cevap