1

I am a bit confused. The PHP :: exists for what specifically. At first, the manual says it is there for accessing constants, but here, in my code, it works for accessing a function too. See. When should I use -> and when should I use ::

<?php

class Read {

    function printing() {
        echo "I am printing";
    }

}

$a = new Read();
Read::printing();
echo "\n";
echo $a->printing();
Ali Gajani
  • 14,762
  • 12
  • 59
  • 100

0 Answers0