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,340
  • 9
  • 53
  • 86

0 Answers0