cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG]: Phalcon\Session\Bag cannot be extends

Open zak-wojtek77 opened this issue 5 years ago • 2 comments

Describe the bug Phalcon\Session\Bag cannot be extends

To Reproduce

class Foo extends Phalcon\Session\Bag
{
}
$foo = new Foo('bar');

Expected behavior After running this code has an error:

Fatal error: Uncaught RuntimeException: Trying to call method set on a non-object Stack trace: #0 [internal function]: Phalcon\Session\Bag->set('name', 'bar') #1 [internal function]: Phalcon\Collection->__set('name', 'bar') #2 test.php(14): Phalcon\Session\Bag->__construct('bar') #3 {main}

Details

  • Phalcon version: 4.0.6
  • PHP Version: 7.4
  • Operating System: Linux Debian
  • Installation type: Compiling from source
  • Zephir version (if any):
  • Server: Nginx
  • Other related info (Database, table schema): MariaDB

zak-wojtek77 avatar Jul 10 '21 05:07 zak-wojtek77

No problem here with version 4.1.0. Try to upgrade your Phalcon version.

wurst-hans avatar Jul 15 '21 04:07 wurst-hans

Really it works in 4.1.0. Thank you.

zak-wojtek77 avatar Jul 15 '21 06:07 zak-wojtek77