1

I am getting an error in my server,

<?php
class Encryption{
    private $_encryptionkey;
    public function setEncryption($key){
        $this->_encryptionkey = $key;
    }
}

when I call

$enc = new Encryption();
$enc->setEncryption("abcd123");

I am getting error

PHP Fatal error:  Uncaught Error: Cannot access private property Encryption::$_encryptionkey

This error keep show event i change _encryptionkey to protected, but error gone if i change to public.

My Server running PHP Version 7.1.0 using phalcon version 3.0.3

Vikrant
  • 4,920
  • 17
  • 48
  • 72
martinadi
  • 11
  • 2

1 Answers1

0

Phalcon doesn't support PHP 7.1 so it's probably bug with Phalcon compilation for PHP 7.1

With PHP 7.0 you will don't have this problem.

yan_kos
  • 36
  • 1
  • 1