Using array_push in method in php

前端 未结 5 1847
抹茶落季
抹茶落季 2021-01-22 05:38

The addRecipients use push_array but it does not work. What am I doing wrong here??

In class.emailer.php

class Emailer
{
public $sender;
public $recipien         


        
5条回答
  •  萌比男神i
    2021-01-22 06:18

    You need to call the parent's constructor from ExtendedEmailer's constructor.

    class ExtendedEmailer extends emailer
    {
      function  __construct(){
        parent::__construct(null); 
      }
    
      // ...
    }
    

    otherwise $recipients is never initialized as an array.

提交回复
热议问题