webdevask.com

Menu

  • Home
  • New
  • Add question

php - Expected type 'array'. Found 'int'.intelephense(1006)

View Original

one text

Solution:

takes a reference of your array and the elements to be added.

Your code should look like this:

array_push(&$this->element, $element);

or a more modern equivalent (and technically faster) variant:

$this->element[] = $element;

The [] operator on an array adds the element.

Source

See also:

  • php สร้าง Google ชีตจากบัญชีบริการ

  • php - Laravel 8.0 Installation Failed

  • javascript - How to include HTML data (tags) as value in "arrayToDataTable" of Google Pie Chart?

  • how to Grouping array in php

  • php - vender folder from my laravel project has more 1k error

© 2021
E-mail: contact@webdevask.com
Back to top